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.
Problem
The frontend in
src/main/resources/static/js/script.jsappends multiple<input type="hidden" name="fileNames">elements (one per uploaded file) into#hidden-file-inputs. However, the backend DTOCreateCaseRequestexposes a singlefileName(String) field, meaning the submittedfileNamesvalues 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
input.name = 'fileNames'→input.name = 'fileName'inscript.jsOption B — Multi-file support (recommended)
CreateCaseRequest.fileName(String) →fileNames(List<String>)CaseService.createTicketandS3Serviceto accept and persist multiple file names per case<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.