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

finishes#187354206 edit-user-profile #19

Closed
wants to merge 1 commit into from

Conversation

gracemugwanezak
Copy link
Contributor

PurposeEditing user-profile

Changes Made

  • created a UserProfileEdit component
  • created a userApi

Testing Instructions

no tests made

Related Issues

No issues

Checklist

Please review the following checklist and make sure all tasks are complete before submitting:

  • Code follows the project's coding standards
  • Changes are covered by tests
  • Documentation is updated (if applicable)
  • All tests pass

Sorry, something went wrong.

Copy link

netlify bot commented Jun 19, 2024

Deploy Preview for e-commerce-mavericks-fn ready!

Name Link
🔨 Latest commit 04f7389
🔍 Latest deploy log https://app.netlify.com/sites/e-commerce-mavericks-fn/deploys/6692ce52bff59a000822f156
😎 Deploy Preview https://deploy-preview-19--e-commerce-mavericks-fn.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@gracemugwanezak gracemugwanezak force-pushed the 187354206-ft-edit-user-profile branch 6 times, most recently from 2d43c06 to 0ca31ad Compare June 26, 2024 14:19
@gracemugwanezak gracemugwanezak force-pushed the 187354206-ft-edit-user-profile branch 4 times, most recently from 5f5e453 to 1269335 Compare July 4, 2024 22:09
@gracemugwanezak gracemugwanezak force-pushed the 187354206-ft-edit-user-profile branch 4 times, most recently from 738d896 to aad4200 Compare July 11, 2024 13:46
@gracemugwanezak gracemugwanezak added bug Something isn't working and removed WIP labels Jul 11, 2024
@gracemugwanezak gracemugwanezak force-pushed the 187354206-ft-edit-user-profile branch 2 times, most recently from 722ddee to 0ba8442 Compare July 11, 2024 19:49
@gracemugwanezak gracemugwanezak added ready and removed bug Something isn't working labels Jul 11, 2024
formState: { errors, isSubmitting },
} = useForm<UserFormValues>();

useEffect(() => {
Copy link
Contributor

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

formData.append('phoneNumber', data.phoneNumber);
formData.append('email', data.email);
formData.append('profileImage', data.photoUrl[0]);
// if (data.photoUrl && data.photoUrl[0]) {
Copy link
Contributor

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);
Copy link
Contributor

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) => {
Copy link
Contributor

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({
Copy link
Contributor

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?

@gracemugwanezak gracemugwanezak force-pushed the 187354206-ft-edit-user-profile branch from 0ba8442 to 92e9a9d Compare July 12, 2024 12:33
Finishes fixing homepage sign in links
@gracemugwanezak gracemugwanezak force-pushed the 187354206-ft-edit-user-profile branch from 92e9a9d to 04f7389 Compare July 13, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants