Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
survey
Commits
32ed197b
Commit
32ed197b
authored
Jul 25, 2022
by
Lee SeoYeon
Browse files
라우터 설정
parent
9cbfffe1
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/src/SurveyRouter.tsx
View file @
32ed197b
...
...
@@ -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
=
{
...
...
frontend/src/answers/AnswerSurveyForm.tsx
View file @
32ed197b
...
...
@@ -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
(
""
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment