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

feat: save settings to the backend #395

Merged
merged 2 commits into from
Oct 8, 2023
Merged

Conversation

VaibhavKVerma
Copy link
Contributor

Feature: Save settings to the backend

My PR closes #380

πŸ‘¨β€πŸ’» Changes proposed

  • Added a new field settings for User Schema.
  • Called getProfile API on user login and fetching the user settings on login and saving it in local storage.
  • Updating the setting whenever user clicks on Update Settings and saving it in local storage.
  • Changed the updateProfile functionality for specific fields.

βœ”οΈ Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.

@vercel
Copy link

vercel bot commented Oct 8, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @Dun-sin on Vercel.

@Dun-sin first needs to authorize it.

Copy link
Owner

@Dun-sin Dun-sin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did great, thanks for contributing, I hope you will stick around and continue to contribute to this project.

Consider giving this project a star and joining the community discord server if you haven't for more resources and opportunities to connect with others. πŸ‘‰πŸ½hereπŸ‘ˆπŸ½

Comment on lines +75 to +79
// Update user's profile with provided fields or the User fields or defaults
user.username = username || user.username || 'Anonymous';
user.aboutMe = aboutMe || user.aboutMe || null;
user.gender = gender || user.gender || 'Unknown';
user.age = age || user.age || null;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next time if you want to make a change that isn't part of your PR, create a new issue, will let this slide for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will keep that in mind.

@Dun-sin Dun-sin merged commit 4603011 into Dun-sin:main Oct 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] save settings to the backend
2 participants