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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user