refactor: form-submit-docs#105
Open
Kajta134 wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the public form submission endpoint to better support/document multipart/form-data submissions (including file uploads) and adjusts DTO transformations to handle typical multipart field encodings.
Changes:
- Added Swagger/OpenAPI
multipart/form-datadocumentation forPOST /public/events/:eventSlug/forms/:id/submit, includingfilesand attribute metadata. - Updated
FormSubmitionDtoto transform empty-string fields toundefinedand to JSON-parseattributeswhen received as a string (common for multipart). - Updated
package-lock.jsonas part of dependency/lockfile normalization.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/forms/forms-public.controller.ts |
Adds multipart/form-data Swagger schema for the submit endpoint. |
src/forms/dto/form-submition.dto.ts |
Adds transforms to handle multipart-encoded fields (empty strings, JSON string attributes). |
package-lock.json |
Lockfile updates (dependency tree normalization). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+84
to
+88
| "- checkbox: boolean\n" + | ||
| "- for files write filename with extension (e.g., 'document.pdf')", | ||
| items: { | ||
| $ref: getSchemaPath(ParticipantAttributeDto), | ||
| }, |
Comment on lines
+76
to
+89
| attributes: { | ||
| type: "array", | ||
| description: | ||
| "Array of participant attributes with their values. \n" + | ||
| "For each attribute, the value must match the attribute type:\n" + | ||
| "- text/select: string\n" + | ||
| "- number: number\n" + | ||
| "- multiSelect/block: string[] (Array of UUIDs or options)\n" + | ||
| "- checkbox: boolean\n" + | ||
| "- for files write filename with extension (e.g., 'document.pdf')", | ||
| items: { | ||
| $ref: getSchemaPath(ParticipantAttributeDto), | ||
| }, | ||
| }, |
Comment on lines
+57
to
+60
| @ApiConsumes("multipart/form-data") | ||
| @ApiBody({ | ||
| schema: { | ||
| type: "object", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.