Skip to content

fix(files-upload): return simple error if exists#1866

Merged
pyphilia merged 2 commits into
mainfrom
file-upload-return-value
May 12, 2025
Merged

fix(files-upload): return simple error if exists#1866
pyphilia merged 2 commits into
mainfrom
file-upload-return-value

Conversation

@pyphilia
Copy link
Copy Markdown
Contributor

@pyphilia pyphilia commented May 8, 2025

Instead of a ResultOf, the endpoint throws an error if one exists.

This return is a bit wrong, since some files might have still been uploaded. But it is easier for the frontend to correctly show errors.

The best solution would be to return ACCEPTED and deal with websockets to correctly return many status codes. But it requires some refactors (websockets, progress, refactor to use uploadMany instead of in serie, etc)

@pyphilia pyphilia requested a review from spaenleh May 8, 2025 08:21
@pyphilia pyphilia self-assigned this May 8, 2025
Comment thread src/services/item/plugins/file/itemFile.controller.ts
@pyphilia pyphilia force-pushed the file-upload-return-value branch from f7c5283 to 6efbe9d Compare May 9, 2025 13:12
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 9, 2025

@pyphilia pyphilia added this pull request to the merge queue May 12, 2025
@pyphilia pyphilia removed this pull request from the merge queue due to a manual request May 12, 2025
@pyphilia pyphilia added this pull request to the merge queue May 12, 2025
Merged via the queue into main with commit 9c48b77 May 12, 2025
9 checks passed
@pyphilia pyphilia deleted the file-upload-return-value branch May 12, 2025 10:50
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.

2 participants