Skip to content

Commit

Permalink
Fix data id problem
Browse files Browse the repository at this point in the history
  • Loading branch information
HRemonen committed Feb 3, 2023
1 parent 80c8d9e commit 5a8274f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/client/components/Recommendations/Recommendations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ const Recommendations: React.FC<{

const dimensions = watch('1')

if (!dimensions) return null

return (
<Container sx={classes.recommendationContainer}>
<Typography variant="h5" sx={classes.heading} component="div">
Expand Down
9 changes: 6 additions & 3 deletions src/client/hooks/useSurvey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ function useSurvey(): Survey {
const [survey, setSurvey] = useState(null)

useEffect(() => {
axios
.get('/api/surveys/0')
.then((facultyData) => setSurvey(facultyData.data))
const fetchSurveyData = async () => {
await axios
.get('/api/surveys/0')
.then((facultyData) => setSurvey(facultyData.data))
}
fetchSurveyData()
}, [])

return survey
Expand Down
9 changes: 5 additions & 4 deletions src/server/db/seeders/data/devQuestionData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ const getQuestionData = () => [
visibility: {},
},
{
id: 3,
surveyId: 0,
priority: 2,
title: {
Expand Down Expand Up @@ -174,7 +175,7 @@ const getQuestionData = () => [
visibility: {},
},
{
id: 3,
id: 4,
surveyId: 0,
priority: 3,
title: {
Expand Down Expand Up @@ -243,7 +244,7 @@ const getQuestionData = () => [
visibility: {},
},
{
id: 4,
id: 5,
surveyId: 0,
parentId: 3,
priority: 0,
Expand Down Expand Up @@ -281,7 +282,7 @@ const getQuestionData = () => [
visibility: {},
},
{
id: 5,
id: 6,
surveyId: 0,
priority: 4,
title: {
Expand Down Expand Up @@ -326,7 +327,7 @@ const getQuestionData = () => [
visibility: {},
},
{
id: 6,
id: 7,
surveyId: 0,
parentId: 2,
priority: 0,
Expand Down

0 comments on commit 5a8274f

Please sign in to comment.