-
Notifications
You must be signed in to change notification settings - Fork 6
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
3 changed files
with
9 additions
and
7 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
// optimistic UPdate로 즐겨찾기 구현 | ||
|
||
import { postFavoriteList } from '@/remote/api/requests/favorite/favorite.get.api'; | ||
import { useMutation } from '@tanstack/react-query'; | ||
|
||
function addFavoriteList() { | ||
import { postFavoriteList } from '@/remote/api/requests/favorite/favorite.get.api'; | ||
|
||
function useAddFavoriteList() { | ||
return useMutation({ | ||
mutationFn: postFavoriteList, | ||
onSuccess: () => {}, | ||
onError: () => {}, | ||
}); | ||
} | ||
|
||
export default addFavoriteList; | ||
export default useAddFavoriteList; |
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,14 +1,15 @@ | ||
// optimistic UPdate로 즐겨찾기 구현 | ||
|
||
import { delFavoriteList } from '@/remote/api/requests/favorite/favorite.get.api'; | ||
import { useMutation } from '@tanstack/react-query'; | ||
|
||
function deleteFavoriteList() { | ||
import { delFavoriteList } from '@/remote/api/requests/favorite/favorite.get.api'; | ||
|
||
function useDeleteFavoriteList() { | ||
return useMutation({ | ||
mutationFn: delFavoriteList, | ||
onSuccess: () => {}, | ||
onError: () => {}, | ||
}); | ||
} | ||
|
||
export default deleteFavoriteList; | ||
export default useDeleteFavoriteList; |