Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: migrate createPresignedPost endpoint for images to TypeScript #604

Merged
merged 10 commits into from
Nov 12, 2020

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Nov 10, 2020

Problem

This PR migrates the createPresignedPost endpoint flow to Typescript (barring router layer).
Adds tests for all the new migrated functions.

Solution

Features:

  • add ExternalError class for errors arising externally (like S3)
  • add AdminFormService#createPresignedPostForImages function
  • add AdminFormController#handleCreatePresignedPostForImages function

Improvements:

  • replace controller handler function used for POST /:formId([a-fA-F0-9]{24})/adminform/images route with migrated TypeScript function
  • Remove all traces of old Javascript handler function

@karrui
Copy link
Contributor Author

karrui commented Nov 10, 2020

Turning into draft, realize I can kill two birds with one stop by doing presigned URL for logos too without much increase in code lol

EDIT: extracted out common code, will still do logos in a separate PR

@karrui karrui marked this pull request as draft November 10, 2020 02:27
@karrui karrui marked this pull request as ready for review November 10, 2020 02:37
Copy link
Contributor

@mantariksh mantariksh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggested minor improvements!

src/app/modules/core/core.errors.ts Show resolved Hide resolved
@karrui karrui merged commit addc16a into develop Nov 12, 2020
@karrui karrui deleted the ref/admin-forms-stream-presigned branch November 12, 2020 09:03
@karrui karrui mentioned this pull request Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants