Skip to content

Commit

Permalink
Fix/Answers mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryczko authored Jan 27, 2024
1 parent e0a9338 commit b9c147f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pages/survey/[surveyId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ import ExternalPageWrapper from 'layout/ExternalRouteWrapper';
export async function getServerSideProps(context: NextPageContext) {
const surveyData = await getSurveyData(context.query.surveyId as string);

if (surveyData) {
surveyData.questions = surveyData?.questions.map((question) => {
return {
...question,
answer: '',
};
});
}

return {
props: {
initialData: JSON.parse(JSON.stringify(surveyData)),
Expand Down

0 comments on commit b9c147f

Please sign in to comment.