added validation for forms, sensitive text fields have been masked

This commit is contained in:
2026-08-21 17:15:02 +02:00
parent 5aa66ff37a
commit 2215766940
19 changed files with 325 additions and 4 deletions
+5 -1
View File
@@ -27,6 +27,10 @@ export type FormValidationResult = {
cleaned: Record<string, unknown>;
form: FormDoc;
ok: true;
} | {
field: string;
ok: false;
reason: 'consent';
} | {
ok: false;
reason: 'not_found';
@@ -44,5 +48,5 @@ export type FormValidationResult = {
* Returns the loaded form on success so the caller doesn't fetch it twice, and
* a code + offending field on failure so the frontend can point at it.
*/
export declare function validateSubmission(payload: BasePayload, formId: string, data: Record<string, unknown>): Promise<FormValidationResult>;
export declare function validateSubmission(payload: BasePayload, formId: string, data: Record<string, unknown>, consentFieldName?: string): Promise<FormValidationResult>;
export {};