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