fix(api): accept submitter details on public draft PUT and submit POST
S3a PR 1 frontend sends public_submitter_name and public_submitter_email on draft saves (PUT) and final submit (POST /submit), but the matching SavePublicDraftRequest and SubmitPublicSubmissionRequest did not whitelist these fields — Laravel's validated() silently stripped them, preventing mid-form name/email updates from persisting. Align both form requests with StartPublicDraftRequest to accept the same submitter fields with identical rules (string, max:150 / email, max:255, nullable). Controller copies present keys onto the submission model and saves when dirty, matching standard Laravel update() semantics — missing keys leave prior values untouched. Closes the backend gap identified in PR 1 smoke test.
This commit is contained in:
@@ -29,6 +29,8 @@ final class SavePublicDraftRequest extends FormRequest
|
||||
$base = [
|
||||
'values' => ['sometimes', 'array'],
|
||||
'first_interacted_at' => ['nullable', 'date'],
|
||||
'public_submitter_name' => ['nullable', 'string', 'max:150'],
|
||||
'public_submitter_email' => ['nullable', 'email', 'max:255'],
|
||||
];
|
||||
|
||||
$schema = $this->resolveSchema();
|
||||
|
||||
Reference in New Issue
Block a user