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
Show whitespace changes
Inline
Side-by-side
frontend/src/SurveyRouter.tsx
View file @
32ed197b
...
@@ -9,6 +9,8 @@ import { Profile } from "./profile";
...
@@ -9,6 +9,8 @@ import { Profile } from "./profile";
import
{
EditResultButton
}
from
"
./survey
"
;
import
{
EditResultButton
}
from
"
./survey
"
;
import
{
EditSurvey
}
from
"
./survey/EditSurvey
"
;
import
{
EditSurvey
}
from
"
./survey/EditSurvey
"
;
import
{
ResultSurvey
}
from
"
./survey/ResultSurvey
"
;
import
{
ResultSurvey
}
from
"
./survey/ResultSurvey
"
;
import
{
CompleteSurvey
}
from
"
./survey/CompleteSurvey
"
;
import
{
SameSurvey
}
from
"
./survey/SameSurvey
"
;
export
const
SurveyRouter
=
()
=>
{
export
const
SurveyRouter
=
()
=>
{
return
(
return
(
...
@@ -18,11 +20,13 @@ export const SurveyRouter = () => {
...
@@ -18,11 +20,13 @@ export const SurveyRouter = () => {
<
Route
index
element
=
{
<
Home
/>
}
/>
<
Route
index
element
=
{
<
Home
/>
}
/>
<
Route
path
=
"login"
element
=
{
<
Login
/>
}
/>
<
Route
path
=
"login"
element
=
{
<
Login
/>
}
/>
<
Route
path
=
"signup"
element
=
{
<
SignUp
/>
}
/>
<
Route
path
=
"signup"
element
=
{
<
SignUp
/>
}
/>
<
Route
path
=
"surveys/
edit
/"
element
=
{
<
EditResultButton
/>
}
>
<
Route
path
=
"surveys/
:surveyId
/"
element
=
{
<
EditResultButton
/>
}
>
<
Route
path
=
"
:surveyId
"
element
=
{
<
EditSurvey
/>
}
/>
<
Route
path
=
"
edit
"
element
=
{
<
EditSurvey
/>
}
/>
<
Route
path
=
"
:surveyId/
result"
element
=
{
<
ResultSurvey
/>
}
/>
<
Route
path
=
"result"
element
=
{
<
ResultSurvey
/>
}
/>
</
Route
>
</
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
<
Route
path
=
"profile"
path
=
"profile"
element
=
{
element
=
{
...
...
frontend/src/answers/AnswerSurveyForm.tsx
View file @
32ed197b
...
@@ -39,8 +39,7 @@ export const AnswerSurveyForm = () => {
...
@@ -39,8 +39,7 @@ export const AnswerSurveyForm = () => {
if
(
isSurvey
)
{
if
(
isSurvey
)
{
console
.
log
(
"
object
"
,
isSurvey
);
console
.
log
(
"
object
"
,
isSurvey
);
alert
(
"
제출한 설문조사입니다
"
);
navigate
(
"
/survey/same
"
);
navigate
(
"
/
"
);
}
}
const
addFiles
=
(
oneFile
:
{
questionId
:
string
;
file
:
File
})
=>
{
const
addFiles
=
(
oneFile
:
{
questionId
:
string
;
file
:
File
})
=>
{
...
@@ -93,7 +92,7 @@ export const AnswerSurveyForm = () => {
...
@@ -93,7 +92,7 @@ export const AnswerSurveyForm = () => {
const
newAnswer
:
AnswerType
=
await
answerApi
.
saveAnswers
(
formData
);
const
newAnswer
:
AnswerType
=
await
answerApi
.
saveAnswers
(
formData
);
console
.
log
(
newAnswer
);
console
.
log
(
newAnswer
);
localStorage
.
setItem
(
`survey_
${
surveyId
}
`
,
surveyId
??
""
);
localStorage
.
setItem
(
`survey_
${
surveyId
}
`
,
surveyId
??
""
);
alert
(
"
제출되었습니다
"
);
navigate
(
"
/survey/complete
"
);
setSuccess
(
true
);
setSuccess
(
true
);
setError
(
""
);
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