Skip to content

Commit

Permalink
[#156] 공지사항/펀시스템 상세정보 page id 리팩토링 (#157)
Browse files Browse the repository at this point in the history
* refactor: [id] 가져오는 방식 변경

* remove: console 삭제
  • Loading branch information
SujinKim1127 authored Dec 28, 2023
1 parent c2507a5 commit d945950
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/notice/info/NoticeInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ const NoticeInfo = () => {
// 현재 주소 값
const router = useRouter();
const path = router.asPath;
const numericPart = path.match(/\d+/);
const pathId = numericPart ? numericPart[0] : 1;
const pathId = router.query.id;

function extractCategoryFromUrl(url: string): string | null {
const regex = /\/(funsystem|notice|community)\/(\d+)/;
Expand All @@ -55,7 +54,6 @@ const NoticeInfo = () => {
const getNoticeInfo = getNoticeInfoAPI(Number(pathId));
getNoticeInfo.then((res) => {
setData(res.data);
console.log(res.data);
});

const getcomments = getNoticeInfoCommentAPI(Number(pathId));
Expand Down

0 comments on commit d945950

Please sign in to comment.