[PR #3157] [MERGED] fix: remove existing team invitation for an invitee when adding invitee to team by admin (HBE-229) #4259

Closed
opened 2026-03-17 01:48:39 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3157
Author: @ankitsridhar16
Created: 6/22/2023
Status: Merged
Merged: 6/22/2023
Merged by: @AndrewBastin

Base: release/2023.4.7Head: fix/duplicate-team-invite


📝 Commits (3)

  • f19dc70 refactor: add service method to take invitee email and team ID as string to fetch invitation
  • 2c7f5f6 fix: add check for existing invitation for the invitee and revoke
  • 596ea7e chore: update variable names

📊 Changes

2 files changed (+43 additions, -2 deletions)

View changed files

📝 packages/hoppscotch-backend/src/admin/admin.service.ts (+14 -2)
📝 packages/hoppscotch-backend/src/team-invitation/team-invitation.service.ts (+29 -0)

📄 Description

Closes #
HBE- 229

Description

When an admin adds an invitee to team by email and team ID the pending team invitation is not revoked. Because of this if this invitee was invited by a team member there would be a team pending team invitation for the invitee which is not required and is invalid hence this PR solves the issue by revoking the invitation.

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Additional Information

Testing Instructions:

  • Create a team and add a user to a team by sending an invitation, an entry would be made to the teamInvitation model.
  • Now add the user by using admin privilege and mutation , the user would be added to the team directly and the existing invitation will be revoked and the entry will be deleted.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3157 **Author:** [@ankitsridhar16](https://github.com/ankitsridhar16) **Created:** 6/22/2023 **Status:** ✅ Merged **Merged:** 6/22/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.4.7` ← **Head:** `fix/duplicate-team-invite` --- ### 📝 Commits (3) - [`f19dc70`](https://github.com/hoppscotch/hoppscotch/commit/f19dc700ef1e4cb1991638d1abcfd2b5f692d266) refactor: add service method to take invitee email and team ID as string to fetch invitation - [`2c7f5f6`](https://github.com/hoppscotch/hoppscotch/commit/2c7f5f617379107a5fdb810d1ddd89e055cef327) fix: add check for existing invitation for the invitee and revoke - [`596ea7e`](https://github.com/hoppscotch/hoppscotch/commit/596ea7e36428bea062041b0deeb2c4389a0079a2) chore: update variable names ### 📊 Changes **2 files changed** (+43 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-backend/src/admin/admin.service.ts` (+14 -2) 📝 `packages/hoppscotch-backend/src/team-invitation/team-invitation.service.ts` (+29 -0) </details> ### 📄 Description <!-- If this pull request closes an issue, please mention the issue number below --> Closes # HBE- 229 ### Description When an admin adds an invitee to team by email and team ID the pending team invitation is not revoked. Because of this if this invitee was invited by a team member there would be a team pending team invitation for the invitee which is not required and is invalid hence this PR solves the issue by revoking the invitation. <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project - [ ] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed ### Additional Information Testing Instructions: - Create a team and add a user to a team by sending an invitation, an entry would be made to the teamInvitation model. - Now add the user by using admin privilege and mutation , the user would be added to the team directly and the existing invitation will be revoked and the entry will be deleted. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:48:39 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4259
No description provided.