-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
refactor: add useQuery on whoami endpoint request #3125
Conversation
…pdate user state in AuthProvider component 📝 (use-get-user.ts): Refactor useGetUserData hook to use mutation function for fetching user data and handling success and error cases in a more structured way
This pull request is automatically being deployed by Amplify Hosting (learn more). |
Pull Request Validation ReportThis comment is automatically generated by Conventional PR Whitelist Report
Result Pull request does not satisfy any enabled whitelist criteria. Pull request will be validated. Validation Report
Result Pull request satisfies all enabled pull request rules. Last Modified at 31 Jul 24 19:42 UTC |
…er used 🔧 (use-get-profile-pictures.ts): Remove unused code related to fetching profile pictures 🔧 (use-preload-images.tsx): Refactor usePreloadImages hook to accept profilePictures as an argument 🔧 (profilePictureChooserComponent/index.tsx): Update usage of usePreloadImages hook to match new signature 🔧 (ProfilePictureForm/index.tsx): Refactor to use useGetProfilePicturesQuery hook instead of handleGetProfilePictures function
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.
I think we can make all this login and autologin code declarative using useQuery, and remove the useEffect in the app.tsx, what do you think?
I think It's a good try! |
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.
LGTM
📝 (authContext.tsx): Add useGetUserData hook to fetch user data and update user state in AuthProvider component
📝 (use-get-user.ts): Refactor useGetUserData hook to use mutation function for fetching user data and handling success and error cases in a more structured way