-
Notifications
You must be signed in to change notification settings - Fork 37
[김찬기] Sprint 10 #297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Lanace
merged 32 commits into
codeit-bootcamp-frontend:Next-김찬기
from
cksrlcks:Next-김찬기-sprint10
Jan 17, 2025
The head ref may contain hidden characters: "Next-\uAE40\uCC2C\uAE30-sprint10"
Merged
[김찬기] Sprint 10 #297
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
c2a39fd
refactor(mentor): PropsWithChildren 교체
cksrlcks 76d0ec2
refactor(mentor): 상품 이미지 업로드 서비스 함수 개선
cksrlcks a22e42c
refactor(mentor): util 함수들 인풋에대한 검증 추가
cksrlcks 55172c7
feat: article type, schema, service 작성
cksrlcks 75e9bfc
feat: Article action 훅 작성
cksrlcks a9f61a0
feat: 이미지업로드 컴포넌트 개선
cksrlcks d4dc45c
fix: 아바타 컴포넌트 수정 (Next Image width 설정)
cksrlcks b754f36
feat: Comment 관련 컴포넌트 개선
cksrlcks ee13623
feat: 중고마켓 작성, 수정시 해당 페이지로 이동하도록 수정
cksrlcks 5dcc2f1
feat: 자유게시판 상세페이지 작업
cksrlcks 1a73a67
feat: 자유게시판 작성페이지 작업
cksrlcks 22032fb
design: 플레이스홀더 메세지 줄바꿈 css 추가
cksrlcks f3607ed
fix: 로딩메세지 수정
cksrlcks d7f0cd3
feat: 목록으로 돌아가기 버튼 작업
cksrlcks f82f654
feat: 게시물 작성 페이지 작업
cksrlcks 099a884
fix: 네비게이션 활성화 수정
cksrlcks fea5f65
fix: placeholder 수정
cksrlcks ce97f3e
fix: middleware match 경로 수정
cksrlcks 89fa285
refactor: 페이지 에러핸들링 수정(최상위 error로 가도록)
cksrlcks 3def569
refactor: 자동으로 static되는 페이지에 dynamic 키워트 제거
cksrlcks 1c14751
refactor: 공용 코멘트 컴포넌트 위치 변경
cksrlcks 871c1cd
fix: 메세지 상수 파일 수정
cksrlcks 42b5ffe
refactor: ssr페이지 에러 처리 개선
cksrlcks 6d2b65d
refactor: try문안에서 redirect를 사용하도록 수정
cksrlcks 4721252
chore: readme 수정
cksrlcks c1aa081
refactor(mentor): axios config params에 쿼리파람 옮기기
cksrlcks e346262
refactor: 게시물 작성완료시 페이지이동 개선
cksrlcks b3d1b3c
fix: axios 에러 타입체크 변경
cksrlcks 9adef1f
feat: 코멘트에 리액트쿼리 사용해보기, 코멘트 리팩토링
cksrlcks 81f8663
chore: console.log 지우기
cksrlcks d55cbf5
refactor: 회원가입, 로그인 서버액션 사용해보기
cksrlcks 9438b13
refactor: force-static 지우기
cksrlcks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| "use server"; | ||
|
|
||
| import { signIn } from "@/auth"; | ||
| import { signinFormSchmea } from "@/schemas/auth"; | ||
| import { CredentialsSignin } from "next-auth"; | ||
| import { isRedirectError } from "next/dist/client/components/redirect-error"; | ||
| import { redirect } from "next/navigation"; | ||
| export default async function action( | ||
| prevState: { message: string }, | ||
| formData: FormData | ||
| ) { | ||
| const parsed = signinFormSchmea.safeParse(Object.fromEntries(formData)); | ||
|
|
||
| if (!parsed.success) { | ||
| return { | ||
| message: "제출양식에 문제가 있습니다. 확인해주세요", | ||
| }; | ||
| } | ||
|
|
||
| try { | ||
| await signIn("credentials", { | ||
| email: parsed.data.email, | ||
| password: parsed.data.password, | ||
| redirect: false, | ||
| }); | ||
| redirect("/"); | ||
| } catch (error) { | ||
| if (isRedirectError(error)) { | ||
| throw error; | ||
| } | ||
|
|
||
| if (error instanceof CredentialsSignin) { | ||
| return { | ||
| message: `로그인 실패 : ${error.code}`, | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| return { | ||
| message: "로그인 성공", | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| "use server"; | ||
|
|
||
| import { signupFormSchema } from "@/schemas/auth"; | ||
| import { signUp } from "@/service/auth"; | ||
| import { isAxiosError } from "axios"; | ||
| import { isRedirectError } from "next/dist/client/components/redirect-error"; | ||
| import { redirect } from "next/navigation"; | ||
|
|
||
| export default async function action( | ||
| prevState: { message: string }, | ||
| formData: FormData | ||
| ) { | ||
| const parsed = signupFormSchema.safeParse(Object.fromEntries(formData)); | ||
|
|
||
| if (!parsed.success) { | ||
| return { | ||
| message: "제출양식에 문제가 있습니다. 확인해주세요", | ||
| }; | ||
| } | ||
|
|
||
| try { | ||
| await signUp({ | ||
| email: parsed.data.email, | ||
| nickname: parsed.data.nickname, | ||
| password: parsed.data.password, | ||
| passwordConfirmation: parsed.data.passwordConfirmation, | ||
| }); | ||
|
|
||
| redirect("/login"); | ||
| } catch (error) { | ||
| if (isRedirectError(error)) { | ||
| throw error; | ||
| } | ||
|
|
||
| if (isAxiosError(error)) { | ||
| const message = | ||
| error.response?.data.message || "알 수 없는 에러가 발생했어요."; | ||
| return { | ||
| message: `회원가입 실패 : ${message}`, | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| return { | ||
| message: "회원가입 성공", | ||
| }; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 실무에서 써본적이 없긴 한데, 보니까 써볼만 한것같긴 하네여...!ㅎㅎ
👍