1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

PM-238 Master Reprompt Enabled Appears on Item in Organization (#5858)

* add-edit components and cipher service updated for organization item saveCiphers
* update cipher service spec file
This commit is contained in:
Jason Ng
2023-08-04 11:45:32 -04:00
committed by GitHub
parent 0bb76e2d06
commit 8613b83d98
5 changed files with 186 additions and 55 deletions

View File

@@ -519,9 +519,12 @@ export class CipherService implements CipherServiceAbstraction {
await this.stateService.setNeverDomains(domains);
}
async createWithServer(cipher: Cipher): Promise<any> {
async createWithServer(cipher: Cipher, orgAdmin?: boolean): Promise<any> {
let response: CipherResponse;
if (cipher.collectionIds != null) {
if (orgAdmin) {
const request = new CipherCreateRequest(cipher);
response = await this.apiService.postCipherAdmin(request);
} else if (cipher.collectionIds != null) {
const request = new CipherCreateRequest(cipher);
response = await this.apiService.postCipherCreate(request);
} else {
@@ -534,9 +537,12 @@ export class CipherService implements CipherServiceAbstraction {
await this.upsert(data);
}
async updateWithServer(cipher: Cipher): Promise<any> {
async updateWithServer(cipher: Cipher, orgAdmin?: boolean, isNotClone?: boolean): Promise<any> {
let response: CipherResponse;
if (cipher.edit) {
if (orgAdmin && isNotClone) {
const request = new CipherRequest(cipher);
response = await this.apiService.putCipherAdmin(cipher.id, request);
} else if (cipher.edit) {
const request = new CipherRequest(cipher);
response = await this.apiService.putCipher(cipher.id, request);
} else {