Skip to content

fix: align fileNames hidden input with backend DTO and support multiple file uploads #134

Description

@coderabbitai

Problem

The frontend in src/main/resources/static/js/script.js appends multiple <input type="hidden" name="fileNames"> elements (one per uploaded file) into #hidden-file-inputs. However, the backend DTO CreateCaseRequest exposes a single fileName (String) field, meaning the submitted fileNames values will not bind to the DTO. As a result, uploaded files are persisted to S3 but never associated with the created case — causing orphaned S3 objects.

Raised in PR #130 review comment: #130 (comment)

Requested by: @viktorlindell12

Options

Option A — Single file only

  • Change input.name = 'fileNames'input.name = 'fileName' in script.js
  • Ensure only one hidden input is ever appended (e.g. only the last uploaded file)

Option B — Multi-file support (recommended)

  • Change CreateCaseRequest.fileName (String) → fileNames (List<String>)
  • Update CaseService.createTicket and S3Service to accept and persist multiple file names per case
  • Keep the frontend appending multiple <input name="fileNames"> entries (Spring MVC will bind them as a list)

Impact

Until this is fixed, no uploaded file will be associated with any created ticket — all uploaded files will be orphaned in S3.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions