cipher with id for bulk share request

This commit is contained in:
Kyle Spearrin 2018-06-13 14:08:28 -04:00
parent 149ae8a59c
commit c42a45e967
2 changed files with 15 additions and 3 deletions

View File

@ -1,16 +1,16 @@
import { CipherRequest } from './cipherRequest'; import { CipherWithIdRequest } from './cipherWithIdRequest';
import { Cipher } from '../domain/cipher'; import { Cipher } from '../domain/cipher';
export class CipherBulkShareRequest { export class CipherBulkShareRequest {
ciphers: CipherRequest[]; ciphers: CipherWithIdRequest[];
collectionIds: string[]; collectionIds: string[];
constructor(ciphers: Cipher[], collectionIds: string[]) { constructor(ciphers: Cipher[], collectionIds: string[]) {
if (ciphers != null) { if (ciphers != null) {
this.ciphers = []; this.ciphers = [];
ciphers.forEach((c) => { ciphers.forEach((c) => {
this.ciphers.push(new CipherRequest(c)); this.ciphers.push(new CipherWithIdRequest(c));
}); });
} }
this.collectionIds = collectionIds; this.collectionIds = collectionIds;

View File

@ -0,0 +1,12 @@
import { CipherRequest } from './cipherRequest';
import { Cipher } from '../domain/cipher';
export class CipherWithIdRequest extends CipherRequest {
id: string;
constructor(cipher: Cipher) {
super(cipher);
this.id = cipher.id;
}
}