diff --git a/frontend/src/routes/guest/register/steps/consent.tsx b/frontend/src/routes/guest/register/steps/consent.tsx index 8e0aba7ce4b869b360f6130372e2e743641dc6f3..e6761163ff6b431cc0fca9063c596d2bbf283135 100644 --- a/frontend/src/routes/guest/register/steps/consent.tsx +++ b/frontend/src/routes/guest/register/steps/consent.tsx @@ -38,9 +38,12 @@ const GuestConsentStep = forwardRef( useFieldArray({ control, name: 'consents' }) const submit: SubmitHandler<GuestConsentData> = (data) => { - console.log('consent submit', data) - - nextHandler(data) + // Exclude consents the guest did not accept an answer for + const submitdata: GuestConsentData = { + consents: data.consents?.filter((cons) => cons.choice !== null), + } + console.log('consent submit', submitdata) + nextHandler(submitdata) } const onSubmit = handleSubmit<GuestConsentData>(submit)