-
Notifications
You must be signed in to change notification settings - Fork 80
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: refactor Create Update user additional info to one api endpoint #101
Feat: refactor Create Update user additional info to one api endpoint #101
Conversation
Update @anitab-org/bridgeintech-maintainers . I've refactor POST and PUT /user/additional_info. Now backend only has one endpoint (PUT /user/additional_info) that will do either Create or Update user additional info. Please review when you have time. Thanks |
13a4c52
to
a54f550
Compare
Note @anitab-org/bridgeintech-maintainers. I've just pushed a typo fix for mocking test patch on test create, now using requests.put patch instead of post |
803beb4
to
eccb1ce
Compare
Update @anitab-org/bridgeintech-maintainers . I've just pushed the last change to this refactoring PRR (hopefully). Now Create personal background dao is removed as there's no need for this anymore. |
eccb1ce
to
8f1e65e
Compare
Fix bug on testing fix typo requests.put mock patch Remove POST user/personal_background Remove Create personal background dao Refactor update method to reemove duplication Rename user_extension instance
8f1e65e
to
98dced8
Compare
return messages.ADDITIONAL_INFO_SUCCESSFULLY_UPDATED, HTTPStatus.OK | ||
user_additional_info = UserExtensionModel.find_by_user_id(user_id) | ||
if not user_additional_info: | ||
user_additional_info = UserExtensionModel(user_id, timezone) |
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.
Sorry I didn't know if userextension is synonymous to user_additional_info. If it is then this also seems fine 👍
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.
Just did a code review seems fine.
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.
The changes made in this PR were tested locally. Following are the results:
-
Code review - Done
-
All possible responses were tested as below:
-
Test PR 101
Screenshot/gif/url: This GIF is too big to upload. View hereExpected Result: As a user, I should be able to update my additional information on BIT API.
Actual Result: Same as expected.
-
-
Tested JSON:
{
"is_organization_rep": true,
"timezone": "UTC-05:00/Eastern Standard Time",
"phone": "777-777-7777",
"mobile": "888-888-8888",
"personal_website": "https://dd.com"
}
4. OS Version: Windows 10
Description
Refactor POST and PUT /user/additional_info to one api endpoint
Fixes #100
Type of Change:
Code/Quality Assurance Only
How Has This Been Tested?
Checklist:
Code/Quality Assurance Only