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

Epic 2 APIs #319

Merged
merged 19 commits into from
Mar 1, 2024
Merged

Epic 2 APIs #319

merged 19 commits into from
Mar 1, 2024

Conversation

hrauniya
Copy link
Collaborator

@hrauniya hrauniya requested a review from DMalone87 January 20, 2024 18:07
Copy link
Collaborator

@DMalone87 DMalone87 left a comment

Choose a reason for hiding this comment

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

Great work! Needs a few changes though.

backend/routes/partners.py Outdated Show resolved Hide resolved
backend/routes/partners.py Outdated Show resolved Hide resolved
@hrauniya
Copy link
Collaborator Author

hrauniya commented Feb 6, 2024

Added changes to admins not being able to demote other admins and moving code from invite_users to "add_members_to_partners".

@hrauniya hrauniya requested a review from DMalone87 February 6, 2024 04:41
Copy link
Collaborator

@DMalone87 DMalone87 left a comment

Choose a reason for hiding this comment

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

Still a few changes needed on this one. Sorry I didn't catch the missing tests issue earlier.

request,
"add_partner_member",

@bp.route("/remove_member", methods=['DELETE'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just like the role change, we shouldn't let an admin forcibly remove another admin without notification.

@@ -221,18 +220,22 @@ def test_partner_pagination(client, example_partners, access_token):
assert res.status_code == 404


Copy link
Collaborator

Choose a reason for hiding this comment

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

We should add tests for the new API endpoints here. We're missing:

  • /invite
  • /join
  • /leave
  • /remove_member
  • /withdraw_invitation
  • /role_change
  • /invitations
  • /stagedinvitations

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've added tests for every endpoint except /invite. That one requires the mail server to be set up. Also, did not add tests for /invitations, and /staged_invitations as those are for the dev env, and I just wanted endpoints to view the current state of the db. We could remove them if you want.

# assert partner_member_obj.partner_id == created["partner_id"]
# assert partner_member_obj.email == created["email"]
# assert partner_member_obj.role == created["role"]
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need to worry about testing the mailing functionality here. We can handle that in a seperate test. For the purposes of these tests, just assume the mail feature is working.

DMalone87
DMalone87 previously approved these changes Feb 27, 2024
Copy link
Collaborator

@DMalone87 DMalone87 left a comment

Choose a reason for hiding this comment

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

Looks good!

@hrauniya
Copy link
Collaborator Author

hrauniya commented Mar 1, 2024

Looks like I have to re-request review for this after fixing some merge conflicts between main and invite_users.

@hrauniya hrauniya requested a review from DMalone87 March 1, 2024 04:43
@DMalone87
Copy link
Collaborator

No problem! You're good to go.

@hrauniya hrauniya merged commit 2c2d664 into codeforboston:main Mar 1, 2024
2 checks 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.

2 participants