From 5c9be1c98dde615209fc657c0c75a0b40e073304 Mon Sep 17 00:00:00 2001 From: RenauxLeaInsee <153934662+RenauxLeaInsee@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:51:59 +0100 Subject: [PATCH] fix content type (#90) * fix content type * fix: surveyList type --- src/components/SurveyList/SurveyList.tsx | 13 ++++--------- src/routes/$survey/resultats.tsx | 4 +++- src/types/ContentSurvey.ts | 3 ++- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/components/SurveyList/SurveyList.tsx b/src/components/SurveyList/SurveyList.tsx index 02b0ed3..0a82df7 100644 --- a/src/components/SurveyList/SurveyList.tsx +++ b/src/components/SurveyList/SurveyList.tsx @@ -4,19 +4,14 @@ import { fr } from "@codegouvfr/react-dsfr"; import content from "resources/content.json"; import { Card } from "@codegouvfr/react-dsfr/Card"; import { List } from "@mui/material"; +import { ContentSurvey } from "types/ContentSurvey"; export const SurveysList = () => { const { t } = useTranslation("SurveyHomepage"); - const surveys = content.specifique - .map(survey => { - return { - titleShort: survey.titleShort, - id: survey.id, - disabledOnWelcomePage: survey.disabledOnWelcomePage, - }; - }) - .filter(survey => survey.disabledOnWelcomePage !== true); + const surveys: ContentSurvey[] = content.specifique.filter( + survey => survey.disabledOnWelcomePage !== true, + ); return (