Skip to content

Commit

Permalink
웹에서 시험 상세 내역을 인증 없이도 볼 수 있게 변경한다. (#26)
Browse files Browse the repository at this point in the history
* refactor: bootJar 이전에 copyDocument 실행으로 수정

* refactor: 시험 intro 까지는 인증이 필요없게 수정
  • Loading branch information
alstn113 authored Jan 14, 2025
1 parent abadb43 commit d5f38b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ tasks.register('copyDocument', Copy) {
into file("src/main/resources/static/docs")
}

build {
bootJar {
dependsOn copyDocument
}
8 changes: 0 additions & 8 deletions web/src/components/exams/ExamSummaryCard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { ExamSummaryResponse } from '@/api/examAPI';
import { Routes } from '@/constants';
import useUser from '@/hooks/useUser';
import { fromNowDate } from '@/lib/date.ts';
import { Button, Card, CardFooter, CardHeader, Chip, Divider, Image } from '@nextui-org/react';
import toast from 'react-hot-toast';
import { useNavigate } from 'react-router';
import BaseCardBody from '../common/BaseCardBody';

Expand All @@ -12,14 +10,8 @@ interface ExamSummaryCardProps {
}

const ExamSummaryCard = ({ exam }: ExamSummaryCardProps) => {
const user = useUser();
const navigate = useNavigate();
const handleExamStart = () => {
if (!user) {
toast.error('로그인이 필요합니다.');
return;
}

navigate(Routes.exam.intro(exam.id));
};

Expand Down
7 changes: 7 additions & 0 deletions web/src/pages/exams/ExamIntroPage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import AsyncBoundary from '@/components/AsyncBoundary';
import { Routes } from '@/constants';
import useGetExam from '@/hooks/api/exam/useGetExam';
import useUser from '@/hooks/useUser';
import { fullDate } from '@/lib/date.ts';
import { Button, Divider } from '@nextui-org/react';
import toast from 'react-hot-toast';
import { useNavigate, useParams } from 'react-router';

const ExamIntroPage = () => {
Expand All @@ -21,10 +23,15 @@ const ExamIntroPage = () => {
};

const ExamProgressContent = ({ examId }: { examId: number }) => {
const user = useUser();
const { data } = useGetExam(examId);
const navigate = useNavigate();

const handleExamStart = () => {
if (!user) {
toast.error('로그인이 필요합니다.');
return;
}
navigate(Routes.exam.progress(examId));
};

Expand Down

0 comments on commit d5f38b9

Please sign in to comment.