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: GET /users/{user_id} api endpoints and tests #99

Merged

Conversation

mtreacy002
Copy link
Member

@mtreacy002 mtreacy002 commented Jul 28, 2020

Description

Allow user to get other membre's personal details

Fixes #98

Type of Change:

  • Code

Code/Quality Assurance Only

  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

  • Make sure you have created 2 users (user a and b) who already verified their email address
  • Login as user a
  • send GET /userrs/{user_id} request by providing the user b id number
  • for successful response (200) you will see below

Screen Shot 2020-07-28 at 11 27 55 pm

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Code/Quality Assurance Only

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@mtreacy002 mtreacy002 self-assigned this Jul 28, 2020
@mtreacy002 mtreacy002 added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Program: GSOC Related to work completed during the Google Summer of Code Program. labels Jul 28, 2020
@mtreacy002 mtreacy002 added this to the GSoc Coding Phase 2 milestone Jul 28, 2020
@mtreacy002 mtreacy002 changed the title WIP | Feat: GET /users/{useer_id} api endpoints and tests WIP | Feat: GET /users/{user_id} api endpoints and tests Jul 28, 2020
@mtreacy002 mtreacy002 force-pushed the issue98-get-other-member-details branch from 9f080b7 to cf988ff Compare July 29, 2020 05:18
@mtreacy002 mtreacy002 changed the title WIP | Feat: GET /users/{user_id} api endpoints and tests Feat: GET /users/{user_id} api endpoints and tests Jul 29, 2020
ramitsawhney27
ramitsawhney27 previously approved these changes Jul 29, 2020
"""

user_id = int(AUTH_COOKIE["user_id"].value)
if user_id == 0:

Choose a reason for hiding this comment

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

if not user_id

Copy link
Member Author

Choose a reason for hiding this comment

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

done. It's now the EAFP try catch 😉

"""

user_id = int(AUTH_COOKIE["user_id"].value)
if user_id == 0:

Choose a reason for hiding this comment

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

if not user_id

Copy link
Member Author

Choose a reason for hiding this comment

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

done. changed to EAFP

ramitsawhney27
ramitsawhney27 previously approved these changes Jul 31, 2020
Fix typo on UserListPersonalDetails class name

Refactor request url to /users

Fix MS request url to GET/users/verified

Simplify get request function
Fix import error

Add tests cases

Refactor setting user_id to EAFP try catch instead of if user_id == 0
@mtreacy002 mtreacy002 force-pushed the issue98-get-other-member-details branch from ae2ff39 to 454c8aa Compare August 11, 2020 12:21
Copy link

@foongminwong foongminwong left a comment

Choose a reason for hiding this comment

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

The changes made in this PR were tested locally. Following are the results:

  1. Code review - Done

  2. All possible responses were tested as below:

    • Test PR 99 - GET /users/{user_id} api endpoints and tests
      Screenshot/gif/url:

      test-bit-backend-pr-99

      Expected Result: As a user, I should be able to get a verified user's information with specified user ID.
      Actual Result: Same as expected.

  3. OS Version: Windows 10

@mtreacy002
Copy link
Member Author

@ramitsawhney27 . Can you please re-approve and merge this PR? Thanks

@ramitsawhney27 ramitsawhney27 merged commit 0d76038 into anitab-org:develop Aug 14, 2020
@mtreacy002 mtreacy002 deleted the issue98-get-other-member-details branch August 30, 2020 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Program: GSOC Related to work completed during the Google Summer of Code Program.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dev: GET /users/{user_id} api endpoints and tests
3 participants