From df6038079336fa6685eb912c202139a7d2812225 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 8 Aug 2023 11:54:42 -0400 Subject: [PATCH] web/satellite: use project members delete http endpoint issue: https://github.com/storj/storj/issues/6136 Change-Id: I717755721dc29714ad161fd311f7226a69acc163 --- web/satellite/src/api/projectMembers.ts | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/web/satellite/src/api/projectMembers.ts b/web/satellite/src/api/projectMembers.ts index fdb555e8a..cb07e61db 100644 --- a/web/satellite/src/api/projectMembers.ts +++ b/web/satellite/src/api/projectMembers.ts @@ -17,20 +17,17 @@ export class ProjectMembersApiGql extends BaseGql implements ProjectMembersApi { * @param emails */ public async delete(projectId: string, emails: string[]): Promise { - const query = - `mutation($projectId: String!, $emails:[String!]!) { - deleteProjectMembers( - publicId: $projectId, - email: $emails - ) {publicId} - }`; + const path = `${this.ROOT_PATH}/${projectId}/members?emails=${encodeURIComponent(emails.toString())}`; + const response = await this.http.delete(path); + if (!response.ok) { + const result = await response.json(); + throw new APIError({ + status: response.status, + message: result.error || 'Failed to delete project members and invitations', + requestID: response.headers.get('x-request-id'), + }); + } - const variables = { - projectId, - emails, - }; - - await this.mutate(query, variables); } /**