1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 22:03:36 +00:00

[AC-2447] Allow the UI to save and close dialog when user removes final Can Manage Collection of an item (#9136)

* update saveCollectionsWithServer to accept a new value if user can no longer manage cipher after requested update
This commit is contained in:
Jason Ng
2024-05-21 12:32:27 -04:00
committed by GitHub
parent b7463d551c
commit 5075d0865e
4 changed files with 36 additions and 6 deletions

View File

@@ -138,6 +138,7 @@ import {
CollectionDetailsResponse,
CollectionResponse,
} from "../vault/models/response/collection.response";
import { OptionalCipherResponse } from "../vault/models/response/optional-cipher.response";
import { SyncResponse } from "../vault/models/response/sync.response";
/**
@@ -566,9 +567,15 @@ export class ApiService implements ApiServiceAbstraction {
async putCipherCollections(
id: string,
request: CipherCollectionsRequest,
): Promise<CipherResponse> {
const response = await this.send("PUT", "/ciphers/" + id + "/collections", request, true, true);
return new CipherResponse(response);
): Promise<OptionalCipherResponse> {
const response = await this.send(
"PUT",
"/ciphers/" + id + "/collections_v2",
request,
true,
true,
);
return new OptionalCipherResponse(response);
}
putCipherCollectionsAdmin(id: string, request: CipherCollectionsRequest): Promise<any> {