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

Feature/64 edit user profile #180

Merged
merged 2 commits into from
Feb 14, 2022
Merged

Feature/64 edit user profile #180

merged 2 commits into from
Feb 14, 2022

Conversation

dtnguyen22
Copy link
Collaborator

Related issue

Fixes #64

Type of Change

  • Feat: Change which adds functionality/new feature
  • Fix: Change which fixes an issue
  • Refactor: Change which improves the structure of the code
  • Docs: Change which improves documentation

Description

  • This PR may be enough for a demo but too dogshit to be merged, need a lot of work to refactor, please give me some advice.
  • This PR is not included UPLOAD function.
  • Currently, this function allows user to edit their info: text fields in Build Edit Mode #37
  • email & password are excluded due to some specific requirements (send email to verify new email, input password again to confirm).
  • Only checks for truthy values, needs more data validation constraints such as length, complexity, format ...etc.

TODO:

  • Maybe we need input type for Preference & Location? currently user.preference.gender, user.location.city ... are passed as String.
  • Codes are too ugly, need to be refactored

Screenshot

Authorized user fetches their data
image

Successful attempt to edit user data
image

User data is updated
image

Unsuccessful attempt due to empty values, this needs more validation constraints as I stated above
image

Testing

Has this pull request been tested?

  • Yes, please refer to the screenshots above.
    Please describe shortly how you tested it:
  • Input all valid values
  • Input some invalid values
  • Input all invalid values

Note

The title of your PR should follow this format: [Type](area): Title

@vercel
Copy link

vercel bot commented Feb 14, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tuanthanh2067/seeksi/2Zdfxw18VC6sRRuWGDvJNhVypE9M
✅ Preview: https://seeksi-git-feature-64-edit-user-profile-tuanthanh2067.vercel.app

Comment on lines +26 to +31
"return type of editUser request"
type EditUserResponse{
code: Int!
success: Boolean!
message: [String]
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just some notes here. Any mutation response should follow a general/standard one (ref: #172) unless they need to add new fields.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll fix this in another issue

bio: String,
distance: Int,
minAge: Int,
maxAge: Int,
Copy link
Collaborator

Choose a reason for hiding this comment

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

longTerm and shortTerm are missing here, but that's ok. We can add them later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

According to the #37 there is no longterm or shortTerm field but yeah we can add it later

Copy link
Collaborator

@oliver-pham oliver-pham left a comment

Choose a reason for hiding this comment

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

Overall, great work 👏 ! I haven't reviewed your validation logic, but the code looks good. I like your idea of returning messages of which field is invalid. Feel free to create a separate issue for refactoring and merge this PR.

@dtnguyen22 dtnguyen22 merged commit 273a081 into main Feb 14, 2022
@dtnguyen22 dtnguyen22 deleted the feature/64-edit-user-profile branch February 14, 2022 19:20
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.

Edit User Profile
2 participants