Contactformulier stuurt het leesbare onderwerp (met hoofdletter) i.p.v. de slug

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-10 23:00:26 +01:00
co-authored by Claude Sonnet 5.5
parent 811ff94df2
commit 75086362ee
6 changed files with 82 additions and 18 deletions
@@ -9,6 +9,7 @@ import {
} from '../../../cms-client/contact';
import { trackEvent } from '../../../shared/analytics/trackEvent';
import { useContactPreselect } from '../../../shared/contact/useContactPreselect';
import { buildSubjectOptions, subjectForSlug } from '../../../shared/contact/subjects';
import { contactForm, contactInfo } from '../data/content';
import { usePackagesQuery } from '../hooks/usePackagesQuery';
@@ -52,17 +53,14 @@ export function ContactFormView({ client, token, refreshToken }: ContactFormView
const { data: packages } = usePackagesQuery();
const preselect = useContactPreselect();
const subjectOptions = useMemo<SubjectOption[]>(
() => [
...(packages ?? []).map((pkg) => ({ value: pkg.slug, label: pkg.title })),
{ value: 'other', label: contactForm.otherSubjectLabel },
],
() => buildSubjectOptions(packages, contactForm.otherSubjectLabel),
[packages],
);
const form = useContactForm({
idPrefix: 'contact',
subjectOptions,
preselect: { subject: preselect.subject, key: preselect.key },
preselect: { subject: subjectForSlug(packages, preselect.subject), key: preselect.key },
client,
token,
refreshToken,