Document toolboxDocument toolbox

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-4274 - Getting 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-3990 - Getting 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-4259 - Getting 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:

ActionMethodURLResponseBody
Retrieve the number of pending Membership InvitationsGET/membershipInvitation/openInvitationCountCount
Retrieve the number of pending Membership Requests for teams that user is adminGET/membershipRequest/openRequestCountCount