keyshade icon indicating copy to clipboard operation
keyshade copied to clipboard

API: Display membership status while fetching workspace members

Open rajdip-b opened this issue 6 months ago • 6 comments

Description

When we hit the /api/workspace/{workspaceId}/members endpoint to fetch all the members of a workspace, we also want to get the membership status of the member, i.e, if they have accepted the invitation or not.

Currently, we just get the id, user and the roles they have. image

Solution

We would want the return type to also include a active field that will be true if the user has accepted the invitation, false otherwise.

  • Update this function to fetch the necessary data: https://github.com/keyshade-xyz/keyshade/blob/fedc43b58b4b8e71f5f70c3cd95e1f35581b9648/apps/api/src/workspace/service/workspace.service.ts#L453-L517
  • The model responsible for storing the invitation status: https://github.com/keyshade-xyz/keyshade/blob/fedc43b58b4b8e71f5f70c3cd95e1f35581b9648/apps/api/src/prisma/schema.prisma#L330-L340
  • Include tests.

rajdip-b avatar Jul 30 '24 16:07 rajdip-b