1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-26406] - [Defect] Cannot import account restricted json (#16709)

* cast boolean values in toSdkCipherView

* update to toSdkCipherView

* fix toSdkCipherView

* fix toSdkCipherView
This commit is contained in:
Jordan Aasen
2025-10-03 09:07:20 -07:00
committed by GitHub
parent 89e866c187
commit a690e9a626
2 changed files with 5 additions and 5 deletions

View File

@@ -349,7 +349,7 @@ export class Cipher extends Domain implements Decryptable<CipherView> {
*/
toSdkCipher(): SdkCipher {
const sdkCipher: SdkCipher = {
id: asUuid(this.id),
id: this.id ? asUuid(this.id) : undefined,
organizationId: this.organizationId ? asUuid(this.organizationId) : undefined,
folderId: this.folderId ? asUuid(this.folderId) : undefined,
collectionIds: this.collectionIds ? this.collectionIds.map(asUuid) : ([] as any),

View File

@@ -325,11 +325,11 @@ export class CipherView implements View, InitializerMetadata {
name: this.name ?? "",
notes: this.notes,
type: this.type ?? CipherType.Login,
favorite: this.favorite,
organizationUseTotp: this.organizationUseTotp,
favorite: this.favorite ?? false,
organizationUseTotp: this.organizationUseTotp ?? false,
permissions: this.permissions?.toSdkCipherPermissions(),
edit: this.edit,
viewPassword: this.viewPassword,
edit: this.edit ?? true,
viewPassword: this.viewPassword ?? true,
localData: toSdkLocalData(this.localData),
attachments: this.attachments?.map((a) => a.toSdkAttachmentView()),
fields: this.fields?.map((f) => f.toSdkFieldView()),