-
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.
- Loading branch information
Showing
34 changed files
with
823 additions
and
1,123 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,10 +1,33 @@ | ||
import { useQuery } from '@tanstack/react-query'; | ||
import { useMutation, useQuery } from '@tanstack/react-query'; | ||
import { CafeLikeReqType } from '@/types/cafe'; | ||
import { cafeKeys } from './../queryKeys'; | ||
import { getRecommendedCafeList } from '.'; | ||
import { getRecommendedCafeList, patchCafeLike } from '.'; | ||
|
||
export function useRecommendedCafeListQuery() { | ||
return useQuery({ | ||
...cafeKeys.recommendedCafeList, | ||
queryFn: getRecommendedCafeList, | ||
}); | ||
} | ||
|
||
// Todo: 쿼리키 추가하기 | ||
export function useCafeLikeMutation({ | ||
cafeId, | ||
isLike, | ||
setLikeState, | ||
}: CafeLikeReqType & { | ||
setLikeState: React.Dispatch<React.SetStateAction<boolean>>; | ||
}) { | ||
return useMutation({ | ||
mutationFn: () => patchCafeLike({ cafeId, isLike }), | ||
onSuccess: (data) => { | ||
// Todo: 성공할 경우 토스트 팝업 띄우기 | ||
const newLikeState = data.data.isLike; | ||
setLikeState(newLikeState); | ||
}, | ||
onError: (error) => { | ||
// Todo: 실패할 경우 토스트 팝업 띄우기 | ||
console.log(error.message); | ||
}, | ||
}); | ||
} |
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 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
8 changes: 1 addition & 7 deletions
8
src/app/_components/recommend/RecommendedCafeCarouselIndicator.tsx
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
Oops, something went wrong.