mirror of
https://github.com/bitwarden/browser
synced 2025-12-06 00:13:28 +00:00
Resolve more than one Sponsorship revoke bug (#14818)
This commit is contained in:
@@ -11,8 +11,10 @@ export abstract class OrganizationSponsorshipApiServiceAbstraction {
|
||||
friendlyName?: string,
|
||||
): Promise<void>;
|
||||
|
||||
abstract deleteRevokeSponsorship: (
|
||||
abstract deleteRevokeSponsorship: (sponsoringOrganizationId: string) => Promise<void>;
|
||||
|
||||
abstract deleteAdminInitiatedRevokeSponsorship: (
|
||||
sponsoringOrganizationId: string,
|
||||
isAdminInitiated?: boolean,
|
||||
sponsoredFriendlyName: string,
|
||||
) => Promise<void>;
|
||||
}
|
||||
|
||||
@@ -44,11 +44,30 @@ export class OrganizationSponsorshipApiService
|
||||
): Promise<void> {
|
||||
const basePath = "/organization/sponsorship/";
|
||||
const hostPath = this.platformUtilsService.isSelfHost() ? "self-hosted/" : "";
|
||||
const queryParam = `?isAdminInitiated=${isAdminInitiated}`;
|
||||
|
||||
return await this.apiService.send(
|
||||
"DELETE",
|
||||
basePath + hostPath + sponsoringOrganizationId + queryParam,
|
||||
basePath + hostPath + sponsoringOrganizationId,
|
||||
null,
|
||||
true,
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
async deleteAdminInitiatedRevokeSponsorship(
|
||||
sponsoringOrganizationId: string,
|
||||
sponsoredFriendlyName: string,
|
||||
): Promise<void> {
|
||||
const basePath = "/organization/sponsorship/";
|
||||
const hostPath = this.platformUtilsService.isSelfHost() ? "self-hosted/" : "";
|
||||
return await this.apiService.send(
|
||||
"DELETE",
|
||||
basePath +
|
||||
hostPath +
|
||||
sponsoringOrganizationId +
|
||||
"/" +
|
||||
encodeURIComponent(sponsoredFriendlyName) +
|
||||
"/revoke",
|
||||
null,
|
||||
true,
|
||||
false,
|
||||
|
||||
Reference in New Issue
Block a user