Count Services for Pending Membership Invitations & Membership Requests
Problem
Currently, the Web Client gather the total number of pending membership invitations and membership requests to show notification on Team tab.
- PLFM-4274Getting issue details... STATUS describes how this number was calculated using existing APIs. Each the services that contributes to the count makes 2 database calls. A user who is admin of N teams would requires c+N API calls. This causes - PLFM-3990Getting issue details... STATUS .
Also, we discourage running count query against the database to fill PaginatedResult's totalNumberOfResult; and planned to replace the use of totalNumberOfResult with nextPageToken. - PLFM-4259Getting issue details... STATUS captures the work related to this.
Proposed Solution
Since Membership Invitation and Membership Request data are stored in 2 different tables in the database, we proposed the following services:
Action | Method | URL | ResponseBody |
---|---|---|---|
Retrieve the number of pending Membership Invitations | GET | /membershipInvitation/openInvitationCount | Count |
Retrieve the number of pending Membership Requests for teams that user is admin | GET | /membershipRequest/openRequestCount | Count |