Skip to content

Commit

Permalink
✨ 질문 재답변 삭제 종료 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
529539 committed May 29, 2024
1 parent 0a210c4 commit 93680ba
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/containers/interview/main/Timer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
autoStartInterview,
confirmQuitInterview,
} from "@utils/alerts/interview";
import { deleteInterview } from "@service/api/interviewDuring";
import { deleteInterview, deleteQuestion } from "@service/api/interviewDuring";

import { StopCircle } from "@svgs/.";
import styles from "./index.module.scss";
Expand All @@ -31,17 +31,22 @@ const Timer = () => {
if (isRunning) setTime(time + 1000);
}, 1000);

const goBack = () =>
deleteInterview(Number(id))
.then(res => {
resetData();
router.push(
location.href.includes("interview")
? "/interview/setup"
: `/question/detail/${id}`,
);
})
.catch(err => console.log(err));
const goBack = () => {
if (location.href.includes("interview"))
deleteInterview(Number(id))
.then(res => {
resetData();
router.push("/interview/setup");
})
.catch(err => console.log(err));
else
deleteQuestion(Number(id))
.then(res => {
resetData();
router.push(`/question/detail/${id}`);
})
.catch(err => console.log(err));
};
useEffect(() => {
resetState();
autoStartInterview(() => {
Expand Down

0 comments on commit 93680ba

Please sign in to comment.