Commit 32ed197b authored by Lee SeoYeon's avatar Lee SeoYeon
Browse files

라우터 설정

parent 9cbfffe1
......@@ -9,6 +9,8 @@ import { Profile } from "./profile";
import { EditResultButton } from "./survey";
import { EditSurvey } from "./survey/EditSurvey";
import { ResultSurvey } from "./survey/ResultSurvey";
import { CompleteSurvey } from "./survey/CompleteSurvey";
import { SameSurvey } from "./survey/SameSurvey";
export const SurveyRouter = () => {
return (
......@@ -18,11 +20,13 @@ export const SurveyRouter = () => {
<Route index element={<Home />} />
<Route path="login" element={<Login />} />
<Route path="signup" element={<SignUp />} />
<Route path="surveys/edit/" element={<EditResultButton />}>
<Route path=":surveyId" element={<EditSurvey />} />
<Route path=":surveyId/result" element={<ResultSurvey />} />
<Route path="surveys/:surveyId/" element={<EditResultButton />}>
<Route path="edit" element={<EditSurvey />} />
<Route path="result" element={<ResultSurvey />} />
</Route>
<Route path="surveys/:surveyId" element={<AnswerSurveyForm />} />
<Route path="survey/:surveyId" element={<AnswerSurveyForm />} />
<Route path="survey/complete" element={<CompleteSurvey />} />
<Route path="survey/same" element={<SameSurvey />} />
<Route
path="profile"
element={
......
......@@ -39,8 +39,7 @@ export const AnswerSurveyForm = () => {
if (isSurvey) {
console.log("object", isSurvey);
alert("제출한 설문조사입니다");
navigate("/");
navigate("/survey/same");
}
const addFiles = (oneFile: { questionId: string; file: File }) => {
......@@ -93,7 +92,7 @@ export const AnswerSurveyForm = () => {
const newAnswer: AnswerType = await answerApi.saveAnswers(formData);
console.log(newAnswer);
localStorage.setItem(`survey_${surveyId}`, surveyId ?? "");
alert("제출되었습니다");
navigate("/survey/complete");
setSuccess(true);
setError("");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment