From a8738104c46384f0444a1f805f801d741fdb6bf0 Mon Sep 17 00:00:00 2001 From: Remko Date: Tue, 2 May 2023 09:30:29 +0200 Subject: [PATCH 1/6] Removed ts-ignore and fixed JSON-parse bug --- pages/trouw-opties/[slug].tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pages/trouw-opties/[slug].tsx b/pages/trouw-opties/[slug].tsx index 075c15de..3e97112e 100644 --- a/pages/trouw-opties/[slug].tsx +++ b/pages/trouw-opties/[slug].tsx @@ -67,9 +67,8 @@ const BlogPost: NextPage = () => { setIsLoading(true); SdgproductService.sdgproductGetItem(marriageOptions.type) - .then((res) => { + .then((res: any) => { setCeremonyTypes( - // @ts-ignore res.embedded.gerelateerdeProducten.map((ceremony: any) => ({ name: ceremony.upnLabel, id: ceremony._self.id, @@ -92,9 +91,8 @@ const BlogPost: NextPage = () => { "PT2H", format(endDate, "yyyy-MM-dd"), selectedDate - ).then((res) => { - // @ts-ignore - setAvailableSlots(JSON.parse(res)[selectedDate].filter((slot: any) => slot.resources.length > 0)); + ).then((res: any) => { + setAvailableSlots(res[selectedDate].filter((slot: any) => slot.resources.length > 0)); }); }, [ceremonyTypes, selectedDate]); From 3345603a6af6e7d5c3088b08350dcc73b05a1879 Mon Sep 17 00:00:00 2001 From: Remko Date: Tue, 2 May 2023 10:47:54 +0200 Subject: [PATCH 2/6] fixed partnership bug --- pages/trouw-opties/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pages/trouw-opties/index.tsx b/pages/trouw-opties/index.tsx index 77ebba02..b1c72878 100644 --- a/pages/trouw-opties/index.tsx +++ b/pages/trouw-opties/index.tsx @@ -48,8 +48,7 @@ export default function MultistepForm1() { setIsLoading(true); SdgproductService.sdgproductGetCollection(undefined, undefined, undefined, weddingOptions) - .then((res) => { - // @ts-ignore + .then((res: any) => { setMarriageOptions({ ...marriageOptions, type: res.results[0].id }); replace(`/trouw-opties/${weddingOptions}`); }) @@ -107,7 +106,7 @@ export default function MultistepForm1() { + From 91e52facbce96c7ed274181b2f360cf9b99f148c Mon Sep 17 00:00:00 2001 From: Remko Date: Thu, 4 May 2023 17:03:00 +0200 Subject: [PATCH 6/6] prettier --- pages/voorgenomen-huwelijk/betalen/succes.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pages/voorgenomen-huwelijk/betalen/succes.tsx b/pages/voorgenomen-huwelijk/betalen/succes.tsx index 3299971a..2f81acd4 100644 --- a/pages/voorgenomen-huwelijk/betalen/succes.tsx +++ b/pages/voorgenomen-huwelijk/betalen/succes.tsx @@ -250,10 +250,13 @@ export default function HuwelijksplannerStep0() { // @ts-ignore AssentService.assentPatchItem(witness.id, { huwelijk: null, - } as Assent).then(() => HuwelijkService.huwelijkGetItem(marriageOptions.huwelijk.id) - .then((res) => { - setHuwelijk(res); - })) .finally(() => setIsLoading(false)); + } as Assent) + .then(() => + HuwelijkService.huwelijkGetItem(marriageOptions.huwelijk.id).then((res) => { + setHuwelijk(res); + }) + ) + .finally(() => setIsLoading(false)); }; return (