UNPKG

@payloadcms/plugin-form-builder

Version:

Form builder plugin for Payload CMS

17 lines 908 B
import type { CollectionBeforeChangeHook } from 'payload'; import type { FormBuilderPluginConfig } from '../../../types.js'; type BeforeChangeParams = Parameters<CollectionBeforeChangeHook>[0]; /** * Handles upload fields in form submissions. * * This hook: * 1. Checks req.files for files matching upload field names (supports multiple files per field) * 2. Validates MIME types and file sizes before uploading * 3. Creates media documents in the appropriate upload collection * 4. Populates submissionUploads with proper Payload upload relationships * 5. Strips upload fields from submissionData (they live in submissionUploads only) * 6. Validates pre-uploaded file IDs for backwards compatibility */ export declare const handleUploads: (beforeChangeParams: BeforeChangeParams, formConfig: FormBuilderPluginConfig) => Promise<Partial<any>>; export {}; //# sourceMappingURL=handleUploads.d.ts.map