Skip to content

Refactor: Remove duplication between uploadFile and handleUpload functions #42

@coderabbitai

Description

@coderabbitai

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions