[AC-2330] Updated Cipher Collections Now Sets Readonly Properly (#8549)

Update putCipherCollection call to get new cipher with updated edit value
This commit is contained in:
Jason Ng 2024-04-12 15:41:05 -04:00 committed by GitHub
parent 44d59f0d8c
commit c701ad9cf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 5 deletions

View File

@ -220,7 +220,7 @@ export abstract class ApiService {
putMoveCiphers: (request: CipherBulkMoveRequest) => Promise<any>;
putShareCipher: (id: string, request: CipherShareRequest) => Promise<CipherResponse>;
putShareCiphers: (request: CipherBulkShareRequest) => Promise<any>;
putCipherCollections: (id: string, request: CipherCollectionsRequest) => Promise<any>;
putCipherCollections: (id: string, request: CipherCollectionsRequest) => Promise<CipherResponse>;
putCipherCollectionsAdmin: (id: string, request: CipherCollectionsRequest) => Promise<any>;
postPurgeCiphers: (request: SecretVerificationRequest, organizationId?: string) => Promise<any>;
putDeleteCipher: (id: string) => Promise<any>;

View File

@ -565,8 +565,12 @@ export class ApiService implements ApiServiceAbstraction {
return this.send("PUT", "/ciphers/share", request, true, false);
}
putCipherCollections(id: string, request: CipherCollectionsRequest): Promise<any> {
return this.send("PUT", "/ciphers/" + id + "/collections", request, true, false);
async putCipherCollections(
id: string,
request: CipherCollectionsRequest,
): Promise<CipherResponse> {
const response = await this.send("PUT", "/ciphers/" + id + "/collections", request, true, true);
return new CipherResponse(response);
}
putCipherCollectionsAdmin(id: string, request: CipherCollectionsRequest): Promise<any> {

View File

@ -683,8 +683,8 @@ export class CipherService implements CipherServiceAbstraction {
async saveCollectionsWithServer(cipher: Cipher): Promise<any> {
const request = new CipherCollectionsRequest(cipher.collectionIds);
await this.apiService.putCipherCollections(cipher.id, request);
const data = cipher.toCipherData();
const response = await this.apiService.putCipherCollections(cipher.id, request);
const data = new CipherData(response);
await this.upsert(data);
}