Skip to content

Commit

Permalink
Merge pull request #197 from Team-Lecue/Hotfix-Rooming
Browse files Browse the repository at this point in the history
Merge Hotfix rooming into dev
  • Loading branch information
Arooming authored Jan 18, 2024
2 parents 29df05d + fbfbb06 commit 212a45b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Detail/components/LecueNoteListContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function LecueNoteListContainer(props: LecueNoteListContainerProps) {
localStorage.getItem('token') &&
localStorage.getItem('token') !== null
) {
navigate(`/create-note/${bookUuid}`, {
navigate(`/create-note`, {
state: { bookId: bookId },
});
} else {
Expand Down
6 changes: 5 additions & 1 deletion src/LecueNote/hooks/usePostLecueNote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const usePostLecueNote = () => {
bookId,
});
},
onError:() => navigate('/error'),
onError: () => navigate('/error'),
onSuccess: (data) => {
const bookUuid = data.data.data.bookUuid;
navigate(`/lecue-book/${bookUuid}`);
},
});
return mutation;
};
Expand Down
4 changes: 1 addition & 3 deletions src/LecueNote/page/LeceuNotePage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react';
import { useLocation, useNavigate, useParams } from 'react-router-dom';
import { useLocation, useNavigate } from 'react-router-dom';

import Header from '../../../components/common/Header';
import LoadingPage from '../../../components/common/LoadingPage';
Expand Down Expand Up @@ -37,7 +37,6 @@ function LecueNotePage() {
const location = useLocation();

const { bookId } = location.state;
const { bookUuid } = useParams() as { bookUuid: string };

const handleClickCategory = (
e: React.MouseEvent<HTMLButtonElement, MouseEvent>,
Expand Down Expand Up @@ -86,7 +85,6 @@ function LecueNotePage() {
isIconClicked: isIconClicked,
bookId: bookId,
});
navigate(`/lecue-book/${bookUuid}`);
};

return putMutation.isLoading || postMutation.isLoading ? (
Expand Down
2 changes: 1 addition & 1 deletion src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Router() {
<Route path="/" element={<SelectView />} />
<Route path="/register" element={<Register />} />
<Route path="/login" element={<Login />} />
<Route path="/create-note/:bookUuid" element={<LecueNotePage />} />
<Route path="/create-note" element={<LecueNotePage />} />
<Route path="/sticker-pack" element={<StickerPack />} />
<Route path="/detail" element={<DetailPage />} />
<Route path="/mypage" element={<Mypage />} />
Expand Down

0 comments on commit 212a45b

Please sign in to comment.