-
Notifications
You must be signed in to change notification settings - Fork 1
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
finishes#187354206 edit-user-profile #19
Conversation
✅ Deploy Preview for e-commerce-mavericks-fn ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
2d43c06
to
0ca31ad
Compare
5f5e453
to
1269335
Compare
738d896
to
aad4200
Compare
722ddee
to
0ba8442
Compare
formState: { errors, isSubmitting }, | ||
} = useForm<UserFormValues>(); | ||
|
||
useEffect(() => { |
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.
why having 2 useEffect hooks? plus, setting the initial userData to the data being fetched,
if the data becomes undefined for some reasons, that would break the app
src/components/profile/Profile.tsx
Outdated
formData.append('phoneNumber', data.phoneNumber); | ||
formData.append('email', data.email); | ||
formData.append('profileImage', data.photoUrl[0]); | ||
// if (data.photoUrl && data.photoUrl[0]) { |
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.
remove this comment
setShowSuccessMessage(true); | ||
setTimeout(() => setShowSuccessMessage(false), 3000); // Hide message after 3 seconds | ||
} catch (err) { | ||
console.error('Failed to update profile:', err); |
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.
this error caught should be handled properly displaying an appropriate message to the client
} | ||
}; | ||
|
||
const getErrorMessage = (error: any) => { |
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 don't see where you are calling this function
@@ -10,8 +11,20 @@ export const userApi = mavericksApi.injectEndpoints({ | |||
}, | |||
}), | |||
}), | |||
updateUser: builder.mutation({ |
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.
could you consider creating your own separate service for easy management?
0ba8442
to
92e9a9d
Compare
Finishes fixing homepage sign in links
92e9a9d
to
04f7389
Compare
PurposeEditing user-profile
Changes Made
Testing Instructions
no tests made
Related Issues
No issues
Checklist
Please review the following checklist and make sure all tasks are complete before submitting: