Description
The uploadFile function in next-ts/src/lib/common/helper-methods.ts duplicates the core logic of handleUpload. Both functions build a FormData from a presigned POST and fetch to S3, but uploadFile lacks size validation and user messaging that handleUpload includes.
Background
This issue was identified during code review and should be addressed before release 1.
Recommendation
Consider one of the following approaches:
- Remove
uploadFile and use handleUpload everywhere
- Extract the shared S3-upload core into a single private helper function used by both
References
Description
The
uploadFilefunction innext-ts/src/lib/common/helper-methods.tsduplicates the core logic ofhandleUpload. Both functions build a FormData from a presigned POST and fetch to S3, butuploadFilelacks size validation and user messaging thathandleUploadincludes.Background
This issue was identified during code review and should be addressed before release 1.
Recommendation
Consider one of the following approaches:
uploadFileand usehandleUploadeverywhereReferences