diff --git a/src/models/export/cipher.ts b/src/models/export/cipher.ts index abb4438b045..07b8b56427d 100644 --- a/src/models/export/cipher.ts +++ b/src/models/export/cipher.ts @@ -15,6 +15,7 @@ export class Cipher { static template(): Cipher { const req = new Cipher(); req.organizationId = null; + req.collectionIds = null; req.folderId = null; req.type = CipherType.Login; req.name = 'Item name'; @@ -34,6 +35,10 @@ export class Cipher { if (view.organizationId == null) { view.organizationId = req.organizationId; } + if (view.collectionIds || req.collectionIds) { + const set = new Set((view.collectionIds ?? []).concat(req.collectionIds ?? [])); + view.collectionIds = [...set]; + } view.name = req.name; view.notes = req.notes; view.favorite = req.favorite; @@ -95,6 +100,7 @@ export class Cipher { type: CipherType; folderId: string; organizationId: string; + collectionIds: string[]; name: string; notes: string; favorite: boolean;