added validation for forms, sensitive text fields have been masked
This commit is contained in:
+5
-1
@@ -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 {};
|
||||
|
||||
Reference in New Issue
Block a user