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:
@@ -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),
|
||||
|
||||
@@ -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()),
|
||||
|
||||
Reference in New Issue
Block a user