-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(client): upload images client flow with s3 presigned #67
base: anmho/fix-api-dev-server
Are you sure you want to change the base?
Conversation
@@ -31,6 +31,6 @@ watch: | |||
# Generates the client SDK from the server's current OpenAPI spec. | |||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add to a lib/api folder for to improve semantics.
@@ -109,12 +109,13 @@ func main() { | |||
} | |||
logger.Info("successfully pinged db") | |||
|
|||
cfg, err := awsConfig.LoadDefaultConfig(ctx) | |||
cfg, err := awsConfig.LoadDefaultConfig(ctx, awsConfig.WithRegion("us-west-2")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force us-west-2 but this should be an environment variable.
@@ -94,6 +96,6 @@ func registerRoutes( | |||
}, | |||
}, protectedGreetHandler()) | |||
|
|||
huma.Get(api, "/create-upload-url", CreateUploadURLHandler(imageService)) | |||
huma.Post(api, "/create-upload-url", CreateUploadURLHandler(imageService)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Post since we are created a presigned upload url resource.
@@ -63,7 +63,7 @@ export default function Page() { | |||
|
|||
if (completeSignIn.status === "complete") { | |||
await setActive({ session: completeSignIn.createdSessionId }); | |||
router.replace("/(home)"); | |||
router.replace("/(tabs)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Navigate to tabs layout as the home.
// Queries | ||
const { isPending: isUploadPending, mutateAsync: uploadImagesMutation } = | ||
useMutation({ | ||
mutationFn: uploadImages, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upload/create journey tab.
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