From 5cb7f1de775f0d1c48effc735402e0662715be53 Mon Sep 17 00:00:00 2001 From: Hyeona01 Date: Wed, 20 Nov 2024 00:47:46 +0900 Subject: [PATCH] =?UTF-8?q?FE:=20[feat]=20params=EB=A5=BC=20=EB=B0=98?= =?UTF-8?q?=EC=98=81=ED=95=98=EC=97=AC=20API=20=EC=97=B0=EA=B2=B0=20#41?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/eyesee-admin/src/app/addExam/page.tsx | 7 ------- .../eyesee-admin/src/app/dashboard/[examId]/page.tsx | 4 +++- src/frontend/eyesee-admin/src/app/providers.tsx | 3 ++- .../eyesee-admin/src/components/mypage/TestCard.tsx | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 src/frontend/eyesee-admin/src/app/addExam/page.tsx diff --git a/src/frontend/eyesee-admin/src/app/addExam/page.tsx b/src/frontend/eyesee-admin/src/app/addExam/page.tsx deleted file mode 100644 index 76199bd..0000000 --- a/src/frontend/eyesee-admin/src/app/addExam/page.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from "react"; - -const AddExamPage = () => { - return
AddExamPage
; -}; - -export default AddExamPage; diff --git a/src/frontend/eyesee-admin/src/app/dashboard/[examId]/page.tsx b/src/frontend/eyesee-admin/src/app/dashboard/[examId]/page.tsx index a0b95aa..5359a81 100644 --- a/src/frontend/eyesee-admin/src/app/dashboard/[examId]/page.tsx +++ b/src/frontend/eyesee-admin/src/app/dashboard/[examId]/page.tsx @@ -4,11 +4,13 @@ import DashBoardSection from "@/components/dashBoard/DashBoardSection"; import UserSection from "@/components/dashBoard/UserSection"; import { useDashboardData } from "@/hooks/api/useDashboard"; import { testSesstion } from "@/types/user"; +import { useParams } from "next/navigation"; import React, { useEffect, useState } from "react"; const DashBoardPage = () => { + const { examId } = useParams(); const [sessionData, setSessionData] = useState(); - const { data } = useDashboardData(1); + const { data } = useDashboardData(Number(examId)); useEffect(() => { if (data) { diff --git a/src/frontend/eyesee-admin/src/app/providers.tsx b/src/frontend/eyesee-admin/src/app/providers.tsx index de83b75..ac92a90 100644 --- a/src/frontend/eyesee-admin/src/app/providers.tsx +++ b/src/frontend/eyesee-admin/src/app/providers.tsx @@ -1,6 +1,6 @@ "use client"; -import { getAccessToken } from "@/utils/auth"; +import { deleteAccessToken, getAccessToken } from "@/utils/auth"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { ReactNode } from "react"; @@ -33,6 +33,7 @@ type ProvidersProps = { export default function Providers({ children }: ProvidersProps) { const queryClient = getQueryClient(); + // TODO: 테스트코드 삭제 console.log(getAccessToken()); return ( diff --git a/src/frontend/eyesee-admin/src/components/mypage/TestCard.tsx b/src/frontend/eyesee-admin/src/components/mypage/TestCard.tsx index 3711602..a76c560 100644 --- a/src/frontend/eyesee-admin/src/components/mypage/TestCard.tsx +++ b/src/frontend/eyesee-admin/src/components/mypage/TestCard.tsx @@ -20,7 +20,7 @@ const TestCard = ({ test, type }: TestCardProps) => { if (type === testState.BEFORE) { return { icon: , - path: `/editExam/${test.examId}`, + path: `/edit-exam/${test.examId}`, label: "Edit", }; } else {