mirror of
https://github.com/bitwarden/browser
synced 2025-12-21 02:33:46 +00:00
[PM-25683] Migrate Cipher model and sub-models (#16974)
* Made domain classes ts-strict compliant and fixed spec files * Fixed domain base class and other test files * Added conditional utils and fixed small nits * removed comments * removd ts expect errors * Added removed counter * renamed test name * fixed tests
This commit is contained in:
@@ -869,13 +869,14 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
response = await this.apiService.postCipherAdmin(request);
|
||||
const data = new CipherData(response, cipher.collectionIds);
|
||||
return new Cipher(data);
|
||||
} else if (cipher.collectionIds != null) {
|
||||
} else if (cipher.collectionIds != null && cipher.collectionIds.length > 0) {
|
||||
const request = new CipherCreateRequest({ cipher, encryptedFor });
|
||||
response = await this.apiService.postCipherCreate(request);
|
||||
} else {
|
||||
const request = new CipherRequest({ cipher, encryptedFor });
|
||||
response = await this.apiService.postCipher(request);
|
||||
}
|
||||
|
||||
cipher.id = response.id;
|
||||
|
||||
const data = new CipherData(response, cipher.collectionIds);
|
||||
|
||||
Reference in New Issue
Block a user