Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
students
survey
Commits
a4cbdf12
Commit
a4cbdf12
authored
Jul 15, 2022
by
Jiwon Yoon
Browse files
catchErrors
parent
da6e69af
Changes
2
Show whitespace changes
Inline
Side-by-side
frontend/src/profile/MySurveyCard.tsx
View file @
a4cbdf12
...
@@ -2,6 +2,7 @@ import React, { useState } from "react";
...
@@ -2,6 +2,7 @@ import React, { useState } from "react";
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
surveyApi
}
from
"
../apis
"
;
import
{
surveyApi
}
from
"
../apis
"
;
import
{
SurveyType
}
from
"
../types
"
;
import
{
SurveyType
}
from
"
../types
"
;
import
{
catchErrors
}
from
"
../helpers
"
;
type
Props
=
{
type
Props
=
{
data
:
SurveyType
;
data
:
SurveyType
;
...
@@ -31,7 +32,7 @@ export const MySurveyCard = ({ data }: Props) => {
...
@@ -31,7 +32,7 @@ export const MySurveyCard = ({ data }: Props) => {
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
"
에러발생
"
);
console
.
log
(
"
에러발생
"
);
//
catchErrors(error, setError)
catchErrors
(
error
,
setError
)
;
}
finally
{
}
finally
{
setLoading
(
false
);
setLoading
(
false
);
}
}
...
...
frontend/src/profile/Profile.tsx
View file @
a4cbdf12
...
@@ -4,11 +4,6 @@ import { surveyApi } from "../apis";
...
@@ -4,11 +4,6 @@ import { surveyApi } from "../apis";
import
{
SurveyType
}
from
"
../types
"
;
import
{
SurveyType
}
from
"
../types
"
;
import
{
MySurveyCard
}
from
"
./MySurveyCard
"
;
import
{
MySurveyCard
}
from
"
./MySurveyCard
"
;
const
testData
=
[
{
id
:
0
,
name
:
"
이름1
"
,
description
:
"
설명1
"
},
{
id
:
1
,
name
:
"
이름2
"
,
description
:
"
설명2
"
},
{
id
:
2
,
name
:
"
이름3
"
,
description
:
"
설명3
"
},
];
export
const
Profile
=
()
=>
{
export
const
Profile
=
()
=>
{
const
navigate
=
useNavigate
();
const
navigate
=
useNavigate
();
const
[
survey
,
setSurvey
]
=
useState
<
SurveyType
>
({
const
[
survey
,
setSurvey
]
=
useState
<
SurveyType
>
({
...
...
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