Skip to content

Commit

Permalink
Merge pull request #195 from Team-Lecue/hotfix/usePostBookError
Browse files Browse the repository at this point in the history
[Hotfix] usePostBook Error Fix
  • Loading branch information
jungwoo3490 authored Jan 18, 2024
2 parents aba004c + 3518767 commit 3b451fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/CreateBook/hooks/usePostBook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const usePostBook = () => {
});
},
onError: () => navigate('/error'),
onSuccess: (data) => {
const { bookUuid } = data;
navigate(`/lecue-book/${bookUuid}`);
},
});
return mutation;
};
Expand Down
3 changes: 1 addition & 2 deletions src/CreateBook/page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ function CreateBook() {
const postMutation = usePostBook();

const handleClickCompleteModal = async () => {
const bookUuid = postMutation.mutate({
postMutation.mutate({
favoriteName: name,
favoriteImage: presignedFileName,
title: title,
description: description,
backgroundColor: backgroundColor,
});
navigate(`/lecue-book/${bookUuid}`);
};

return postMutation.isLoading ? (
Expand Down

0 comments on commit 3b451fb

Please sign in to comment.