-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/prgrms-web-devcourse/Tea…
…m-12-ReviewRanger-FE into REV-293/프로필-이미지-업로드-기능-구현
- Loading branch information
Showing
61 changed files
with
801 additions
and
430 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,12 +1,21 @@ | ||
import { useMutation } from '@tanstack/react-query' | ||
import { useMutation, useQueryClient } from '@tanstack/react-query' | ||
import apiClient from '@/apis/apiClient' | ||
|
||
const useDeleteSurvey = () => { | ||
const deleteSurvey = async ({ surveyId }: { surveyId: string }) => { | ||
return await apiClient.delete(`/surveys/${surveyId}`) | ||
} | ||
const deleteReview = async ({ reviewId }: { reviewId: number }) => { | ||
return await apiClient.delete(`/reviews/${reviewId}`) | ||
} | ||
|
||
const useDeleteReview = () => { | ||
const queryClient = useQueryClient() | ||
|
||
return useMutation({ mutationFn: deleteSurvey }) | ||
return useMutation({ | ||
mutationFn: deleteReview, | ||
onSuccess: () => { | ||
queryClient.invalidateQueries({ | ||
queryKey: ['/reviews', '/participation'], | ||
}) | ||
}, | ||
}) | ||
} | ||
|
||
export default useDeleteSurvey | ||
export default useDeleteReview |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//NOTE - 작성자별 응답 결과 단일 조회 | ||
import { useSuspenseQuery } from '@tanstack/react-query' | ||
import apiClient from '@/apis/apiClient' | ||
import { Response } from './useGetResponseByReceiver' | ||
|
||
//NOTE - 참여 ID | ||
const useGetResponseByResponser = ({ | ||
responserId, | ||
reviewId, | ||
}: { | ||
responserId: string | ||
reviewId: string | ||
}) => { | ||
const getResponse = async () => { | ||
const singleAuthorResponse = await apiClient.get<Response>( | ||
`/reviews/${reviewId}/responser/${responserId}/creator`, | ||
) | ||
|
||
return singleAuthorResponse.data | ||
} | ||
|
||
return useSuspenseQuery({ | ||
queryKey: [`/reviews/${reviewId}/responser/${responserId}/creator`], | ||
queryFn: getResponse, | ||
}) | ||
} | ||
export default useGetResponseByResponser |
Oops, something went wrong.