-
Notifications
You must be signed in to change notification settings - Fork 67
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/editable profile #376
Feat/editable profile #376
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊 |
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.
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.
looks good to me, some things to change:
- don't use contains in updating as it is affecting all users
- check if email already in use by other user
- if user changes email, mark user verified status to false
@VaibhavArora314 I think there is no function named 'updateFirst'. in order to do so first will have to do findFirst and then 'update' that record. otherwise if i use updateMany, all the data contains that userID will be updated means in follow list, or in post or where ever it is in use. |
don't use contains while updating since that is affecting multiple users. you can use updateMany but don't use contains for id in where |
okay |
toast.success(response.data.message) | ||
dismiss() | ||
}catch (e){ | ||
const axiosError = e as AxiosError<{ |
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.
Avoid as
whenever possible as it does a force conversion to the specified type.
Potential solution is:
const axiosError = e as AxiosError<{ | |
const axiosError: AxiosError<{ error: { message: string; }}> = e; |
You would need to test if it directly works also if you fell the error is commonly used, you can create a type and pass directly.
For instance:
type ErrorType = { error: { message: string; }};
const axiosError: AxiosError<ErrorType> = e;
|
||
setError((e) => { | ||
if (axiosError?.response?.data?.error) | ||
return axiosError?.response?.data?.error as typeof e; |
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.
See here also if you can avoid type convertion using as
keyword. If it doesn't work you can avoid. Do try and let me know.
… feat/editable_profile # Conflicts: # backend/src/routes/user/route.ts # frontend/src/App.tsx
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.
looking good but after the user updates his details, the updated details should be shown on the profile as currently, it is showing old details and user has to reload to see updated details
… feat/editable_profile
is it okay now?? |
🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. Keep up the fantastic work! 🚀 |
Pull Request
Title
Feature update : Editable profile #127
Description
this PR adds the feature of the editable profile. User can edit their profile in profile section
Related Issues
Fixes #127
Changes Made
Checklist
Screenshots (if applicable)
Recording.2024-07-06.022704.mp4
Additional Notes
HMU if any changes needed
Footer