-
Notifications
You must be signed in to change notification settings - Fork 4
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
[ Fix ] 약속 리스트 페이지 에러 처리 #287
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c674abb
fix: 약속 신청시 로딩 스피너 추가
se0jinYoon 5a16fdb
chore: 페이지 라우팅 주석
se0jinYoon 2c1c732
feat: [선배] 약속 디테일 페이지 에러처리 - 에러페이지로 이동
se0jinYoon a1e1b94
chore: 구글밋 에러 콘솔 변경
se0jinYoon dc70497
chore: 코드 위치 수정
se0jinYoon 080f4cb
feat: [선배] 약속 디테일 쿼리함수 isError반환
se0jinYoon 9d08fe5
feat: [후배] 약속 디테일 페이지 에러처리
se0jinYoon 322e44d
feat: 구글밋 입장 에러 처리 - 에러페이지로 이동
se0jinYoon bac45ff
chore: 코드리뷰 반영, 조건부 정리
se0jinYoon 90e65ab
chore: merge develop
se0jinYoon 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 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 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 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 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 |
---|---|---|
|
@@ -18,7 +18,7 @@ export const usePatchSeniorReject = (onSuccessCallback?: () => void) => { | |
const queryClient = useQueryClient(); | ||
|
||
const navigate = useNavigate(); | ||
const { mutate, data } = useMutation({ | ||
const { mutate, data, isError } = useMutation({ | ||
mutationKey: [QUERY_KEY_PROMISE_DETAIL.patchSeniorReject], | ||
mutationFn: ({ appointmentId, rejectReason, rejectDetail }: patchSeniorRejectRequestType) => | ||
patchSeniorReject({ appointmentId, rejectReason, rejectDetail }), | ||
|
@@ -34,12 +34,12 @@ export const usePatchSeniorReject = (onSuccessCallback?: () => void) => { | |
}, | ||
}); | ||
|
||
return { mutate, data }; | ||
return { mutate, data, isError }; | ||
}; | ||
|
||
// 구글밋 링크 받기 | ||
export const usePostGoogleMeetLink = (onSuccessCallback?: (data: string) => void) => { | ||
const { mutate, data } = useMutation({ | ||
const { mutate, data, isPending, isError } = useMutation({ | ||
mutationKey: [QUERY_KEY_PROMISE_DETAIL.postGoogleMeetLink], | ||
mutationFn: postGoogleMeetLink, | ||
onSuccess: (data) => { | ||
|
@@ -49,15 +49,15 @@ export const usePostGoogleMeetLink = (onSuccessCallback?: (data: string) => void | |
}, | ||
}); | ||
|
||
return { mutate, data }; | ||
return { mutate, data, isPending, isError }; | ||
}; | ||
|
||
// 선배 약속 수락 | ||
export const usePatchSeniorAccept = (onSuccessCallback?: () => void) => { | ||
const navigate = useNavigate(); | ||
const queryClient = useQueryClient(); | ||
|
||
const { mutate, data } = useMutation({ | ||
const { mutate, data, isPending, isError } = useMutation({ | ||
mutationKey: [QUERY_KEY_PROMISE_DETAIL.patchSeniorAccept], | ||
mutationFn: ({ appointmentId, googleMeetLink, timeList }: patchSeniorAcceptRequestType) => | ||
patchSeniorAccept({ appointmentId, googleMeetLink, timeList }), | ||
|
@@ -74,11 +74,11 @@ export const usePatchSeniorAccept = (onSuccessCallback?: () => void) => { | |
}, | ||
}); | ||
|
||
return { mutate, data }; | ||
return { mutate, data, isPending, isError }; | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hook 폴더로 빼서 파일 분리 해주면 좋을 것 같아요! |
||
|
||
export const useGetPromiseDetail = (appointmentId: number) => { | ||
const { data, isSuccess, isLoading } = useQuery({ | ||
const { data, isSuccess, isLoading, isError } = useQuery({ | ||
queryKey: [QUERY_KEY_PROMISE_DETAIL.getPromiseDetail, appointmentId], | ||
queryFn: () => getPromiseDetail(appointmentId), | ||
}); | ||
|
@@ -116,5 +116,6 @@ export const useGetPromiseDetail = (appointmentId: number) => { | |
personalTopic, | ||
isSuccess, | ||
isLoading, | ||
isError | ||
}; | ||
}; |
This file contains 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 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 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 |
---|---|---|
|
@@ -17,11 +17,12 @@ interface PromiseTapPropType { | |
const PromiseTap = (props: PromiseTapPropType) => { | ||
const location = useLocation(); | ||
const navigate = useNavigate(); | ||
const [tap, setTap] = useState('pending'); | ||
const { userRole, pending, scheduled, past, myNickname } = props; | ||
|
||
const { userRole, pending, scheduled, past, myNickname } = props; | ||
const { prevTap } = location.state || {}; | ||
|
||
const [tap, setTap] = useState('pending'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P4) 개인적인 생각으로 tap 이라는 변수명이 의도가 직관적으로 와닿지 않아서 appointmentStatus 등의 의미가 드러나는 이름을 사용하면 좋을 것 같습니다! |
||
|
||
useEffect(() => { | ||
if (prevTap && Object.keys(prevTap).length !== 0) { | ||
setTap(prevTap); | ||
|
This file contains 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
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.
viewType에 따라 text랑 Img만 조건부 넣어주면 더 깔끔해질 것 같아요!