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
56f90932
Commit
56f90932
authored
Jul 22, 2022
by
Lee SeoYeon
Browse files
저장시 alert창 페이지 이동
parent
9ab6dda5
Changes
1
Show whitespace changes
Inline
Side-by-side
frontend/src/survey/EditSurvey.tsx
View file @
56f90932
import
React
,
{
FormEvent
,
useEffect
,
useState
}
from
"
react
"
;
import
{
useParams
}
from
"
react-router-dom
"
;
import
{
useNavigate
,
useParams
}
from
"
react-router-dom
"
;
import
{
questionApi
,
surveyApi
}
from
"
../apis
"
;
import
{
SpinnerIcon
}
from
"
../icons
"
;
import
{
Question
}
from
"
../questions
"
;
...
...
@@ -14,6 +14,7 @@ export const EditSurvey = () => {
const
[
error
,
setError
]
=
useState
(
""
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
success
,
setSuccess
]
=
useState
(
false
);
const
navigate
=
useNavigate
();
const
[
survey
,
setSurvey
]
=
useState
<
SurveyType
>
({
_id
:
surveyId
,
user
:
{},
...
...
@@ -54,6 +55,8 @@ export const EditSurvey = () => {
const
newSurvey
:
SurveyType
=
await
surveyApi
.
editSurvey
(
survey
);
console
.
log
(
newSurvey
);
setSuccess
(
true
);
alert
(
"
저장되었습니다
"
);
navigate
(
"
/profile
"
);
setError
(
""
);
}
catch
(
error
)
{
catchErrors
(
error
,
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