From f3807d77c316cd16f9b5d5992d883354074479f3 Mon Sep 17 00:00:00 2001 From: Remko Date: Tue, 16 Apr 2024 13:09:31 +0200 Subject: [PATCH] hotfix --- .env | 2 +- pages/extra/index.tsx | 53 +++++++++++++++++++++++-------------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/.env b/.env index 0d150ac..596c511 100644 --- a/.env +++ b/.env @@ -6,7 +6,7 @@ NPM_REGISTRY= NPM_TOKEN= VCS_REF= VERSION= -NEXT_PUBLIC_API_URL=https://api.huwelijksplanner.online/api +NEXT_PUBLIC_API_URL=https://api.huwelijksplanner.online/ NEXT_PUBLIC_MATOMO_URL=https://stats.utrecht.nl/analytics/ NEXT_PUBLIC_MATOMO_SITE_ID=5 NEXT_PUBLIC_NL_DESIGN_THEME_CLASSNAME=leiden-theme diff --git a/pages/extra/index.tsx b/pages/extra/index.tsx index 1e18336..01314af 100644 --- a/pages/extra/index.tsx +++ b/pages/extra/index.tsx @@ -72,33 +72,33 @@ export default function MultistepForm1() { return; } - const test = getCosts(formData).toString(); - if (!reservation) return; setSaving(true); - setMarriageOptions({ - ...marriageOptions, - reservation: { - ...reservation, - "ceremony-price-amount": test, - }, - }); - - setSaving(false); - push("/voorgenomen-huwelijk/checken"); - - // HuwelijkService.huwelijkPatchItem({ - // id: marriageOptions.id as string, - // requestBody: { - // producten: [formData["marriage-certificate-kind"]], - // }, - // }) - // .then(({ kosten }) => { - - // }) - // .finally(() => setSaving(false)); + if (marriageOptions.id) { + HuwelijkService.huwelijkGet({ id: marriageOptions.id.toString() }).then((response: any) => { + // Kosten + HuwelijkService.huwelijkPostEigenschap({ + requestBody: { + zaak: `https://api.huwelijksplanner.online/api/zrc/v1/zaken/${response.id ?? ""}`, + eigenschap: + "https://api.huwelijksplanner.online/api/ztc/v1/eigenschappen/416de8b8-d5d1-4f44-9a1e-1846d552292c", + waarde: getCosts(formData["marriage-certificate-kind"]).toString() ?? "", + }, + }).finally(() => { + setMarriageOptions({ + ...marriageOptions, + reservation: { + ...reservation, + "ceremony-price-amount": getCosts(formData["marriage-certificate-kind"]).toString(), + }, + }); + setSaving(false); + push("/voorgenomen-huwelijk/checken"); + }); + }); + } }; return ( @@ -171,7 +171,12 @@ export default function MultistepForm1() { )} -