Skip to content

Commit

Permalink
Merge pull request #312 from GDSC-PKNU-Official/fix/#311
Browse files Browse the repository at this point in the history
Fix/#311: 공지사항 페이지에서 히스토리 관리 추가
  • Loading branch information
pp449 authored Jan 25, 2024
2 parents 0b45124 + f48520d commit 2e85813
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/hooks/useRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const useRouter = () => {
return {
currentPath: window.location.pathname,
routerTo: (path: To) => router(path),
replaceTo: (path: To) => router(path, { replace: true }),
goBack: () => router(-1 as To),
};
};
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Announcement/components/AnnounceContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ const AnnounceContainer = ({
const { type } = useParams();
if (!type) return <></>;

const { routerTo } = useRouter();
const { replaceTo } = useRouter();

const showNormalAnnouncement = () =>
routerTo(PATH.NORMAL_ANNOUNCEMENT(category));
replaceTo(PATH.NORMAL_ANNOUNCEMENT(category));
const showPinnedAnnouncement = () =>
routerTo(PATH.PINNED_ANNOUNCEMENT(category));
replaceTo(PATH.PINNED_ANNOUNCEMENT(category));

const resource = useMemo(
() => fetchAnnounceList<AnnounceItemList>(endPoint),
Expand Down

0 comments on commit 2e85813

Please sign in to comment.