[PR #3740] [CLOSED] HBE-348 feature: user invitation revoke from admin dashboard #4514

Closed
opened 2026-03-17 02:02:35 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3740
Author: @mirarifhasan
Created: 1/10/2024
Status: Closed

Base: mainHead: feat/user-invitation-revoke


📝 Commits (5)

  • b9c36fa feat: revokeUserInviteByAdmin mutation added and invitedUsers query updated
  • 5fc9b56 test: update test case for fetchInvitedUsers
  • 20e8b50 chore: pass adminUid to service function
  • ac0f3ba test: added test case for revokeUserInvite function
  • f3387d0 chore: update mutation name to revokeUserInvitationByAdmin

📊 Changes

6 files changed (+159 additions, -10 deletions)

View changed files

📝 packages/hoppscotch-backend/src/admin/admin.resolver.ts (+29 -0)
📝 packages/hoppscotch-backend/src/admin/admin.service.spec.ts (+60 -3)
📝 packages/hoppscotch-backend/src/admin/admin.service.ts (+58 -6)
📝 packages/hoppscotch-backend/src/admin/invited-user.model.ts (+6 -0)
📝 packages/hoppscotch-backend/src/errors.ts (+5 -0)
📝 packages/hoppscotch-backend/src/pubsub/topicsDefs.ts (+1 -1)

📄 Description

Closes HSB-350

Description

This PR introduces a mutation in hoppscotch-backend that can revoke a user invitation from the admin dashboard.

  • If an admin invites a person, but the person does not accept the invitation, only in that case, the person's invitation can be revocable.
  • Once the person accepts the invitation, then that invitation should not be revocable. To delete that person, admin should follow the delete_user flow.

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

How to Test:

mutation {
  revokeUserInviteByAdmin(inviteeEmail: "test@gmail.com")
}

subscription {
  userInvited {
    adminUid
    adminEmail
    inviteeEmail
    invitedOn
    isInvitationAccepted
  }
}

Additional Information

Nil


🔄 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/3740 **Author:** [@mirarifhasan](https://github.com/mirarifhasan) **Created:** 1/10/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/user-invitation-revoke` --- ### 📝 Commits (5) - [`b9c36fa`](https://github.com/hoppscotch/hoppscotch/commit/b9c36faaa4126d04e29ba4f2f9c2e1572d9d2e70) feat: revokeUserInviteByAdmin mutation added and invitedUsers query updated - [`5fc9b56`](https://github.com/hoppscotch/hoppscotch/commit/5fc9b5660a8e3f863dfd2f7fc8d34251d88703b1) test: update test case for fetchInvitedUsers - [`20e8b50`](https://github.com/hoppscotch/hoppscotch/commit/20e8b50524158ddf45cbe88a1575bf1f5f70ab83) chore: pass adminUid to service function - [`ac0f3ba`](https://github.com/hoppscotch/hoppscotch/commit/ac0f3babbbd27dc1047948cc8398e3fc5efdd41d) test: added test case for revokeUserInvite function - [`f3387d0`](https://github.com/hoppscotch/hoppscotch/commit/f3387d06e31aa61c3a4e74d030f19f9108a68f73) chore: update mutation name to revokeUserInvitationByAdmin ### 📊 Changes **6 files changed** (+159 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-backend/src/admin/admin.resolver.ts` (+29 -0) 📝 `packages/hoppscotch-backend/src/admin/admin.service.spec.ts` (+60 -3) 📝 `packages/hoppscotch-backend/src/admin/admin.service.ts` (+58 -6) 📝 `packages/hoppscotch-backend/src/admin/invited-user.model.ts` (+6 -0) 📝 `packages/hoppscotch-backend/src/errors.ts` (+5 -0) 📝 `packages/hoppscotch-backend/src/pubsub/topicsDefs.ts` (+1 -1) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> <!-- Issue # here --> Closes HSB-350 ### Description <!-- Add a brief description of the pull request --> This PR introduces a mutation in `hoppscotch-backend` that can revoke a user invitation from the admin dashboard. * If an admin invites a person, but the person **does not accept the invitation**, only in that case, the person's invitation can be revocable. * Once the **person accepts the invitation**, then that invitation should not be revocable. To delete that person, admin should follow the delete_user flow. <!-- 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 ### How to Test: ``` mutation { revokeUserInviteByAdmin(inviteeEmail: "test@gmail.com") } subscription { userInvited { adminUid adminEmail inviteeEmail invitedOn isInvitationAccepted } } ``` ### Additional Information <!-- Any additional information like breaking changes, dependencies added, screenshots, comparisons between new and old behaviour, etc. --> Nil --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:02:35 +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#4514
No description provided.