Skip to content
Snippets Groups Projects
Commit a0f24e4f authored by Jonas Braathen's avatar Jonas Braathen
Browse files

Merge branch 'GREG-187-make-optionals-optional' into 'master'

Stop posting consents the guest did not answer

See merge request !272
parents 8adce1a8 11caacd5
No related branches found
No related tags found
1 merge request!272Stop posting consents the guest did not answer
Pipeline #114865 passed
...@@ -38,9 +38,12 @@ const GuestConsentStep = forwardRef( ...@@ -38,9 +38,12 @@ const GuestConsentStep = forwardRef(
useFieldArray({ control, name: 'consents' }) useFieldArray({ control, name: 'consents' })
const submit: SubmitHandler<GuestConsentData> = (data) => { const submit: SubmitHandler<GuestConsentData> = (data) => {
console.log('consent submit', data) // Exclude consents the guest did not accept an answer for
const submitdata: GuestConsentData = {
nextHandler(data) consents: data.consents?.filter((cons) => cons.choice !== null),
}
console.log('consent submit', submitdata)
nextHandler(submitdata)
} }
const onSubmit = handleSubmit<GuestConsentData>(submit) const onSubmit = handleSubmit<GuestConsentData>(submit)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment