feat(client): upload images client flow with s3 presigned#67
Open
anmho wants to merge 8 commits intoanmho/fix-api-dev-serverfrom
Open
feat(client): upload images client flow with s3 presigned#67anmho wants to merge 8 commits intoanmho/fix-api-dev-serverfrom
anmho wants to merge 8 commits intoanmho/fix-api-dev-serverfrom
Conversation
anmho
commented
Dec 9, 2024
| gen: | ||
| @$(MAKE) -C api openapi | ||
| @orval --input ./api/openapi.yaml --output ./client-v2/gen/openapi.ts | ||
| @orval --input ./api/openapi.yaml --output ./client-v2/lib/api/happened.ts |
Collaborator
Author
There was a problem hiding this comment.
Add to a lib/api folder for to improve semantics.
anmho
commented
Dec 9, 2024
| logger.Info("successfully pinged db") | ||
|
|
||
| cfg, err := awsConfig.LoadDefaultConfig(ctx) | ||
| cfg, err := awsConfig.LoadDefaultConfig(ctx, awsConfig.WithRegion("us-west-2")) |
Collaborator
Author
There was a problem hiding this comment.
Force us-west-2 but this should be an environment variable.
anmho
commented
Dec 9, 2024
| }, protectedGreetHandler()) | ||
|
|
||
| huma.Get(api, "/create-upload-url", CreateUploadURLHandler(imageService)) | ||
| huma.Post(api, "/create-upload-url", CreateUploadURLHandler(imageService)) |
Collaborator
Author
There was a problem hiding this comment.
Post since we are created a presigned upload url resource.
anmho
commented
Dec 9, 2024
| if (completeSignIn.status === "complete") { | ||
| await setActive({ session: completeSignIn.createdSessionId }); | ||
| router.replace("/(home)"); | ||
| router.replace("/(tabs)"); |
Collaborator
Author
There was a problem hiding this comment.
Navigate to tabs layout as the home.
anmho
commented
Dec 9, 2024
| // Queries | ||
| const { isPending: isUploadPending, mutateAsync: uploadImagesMutation } = | ||
| useMutation({ | ||
| mutationFn: uploadImages, |
Collaborator
Author
There was a problem hiding this comment.
Upload/create journey tab.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented client using React-Query.
Used a Promise.all approach and displayed upload state to the user.
Updated http method to from GET to POST for
/create-upload-url