Skip to content

refactor: form-submit-docs#105

Open
Kajta134 wants to merge 3 commits into
developfrom
refactor/better-docs-in-form-submit
Open

refactor: form-submit-docs#105
Kajta134 wants to merge 3 commits into
developfrom
refactor/better-docs-in-form-submit

Conversation

@Kajta134
Copy link
Copy Markdown
Contributor

No description provided.

@Kajta134 Kajta134 self-assigned this May 24, 2026
Copilot AI review requested due to automatic review settings May 24, 2026 14:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-data documentation for POST /public/events/:eventSlug/forms/:id/submit, including files and attribute metadata.
  • Updated FormSubmitionDto to transform empty-string fields to undefined and to JSON-parse attributes when received as a string (common for multipart).
  • Updated package-lock.json as 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",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants