mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 07:13:32 +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 {
|
toSdkCipher(): SdkCipher {
|
||||||
const sdkCipher: SdkCipher = {
|
const sdkCipher: SdkCipher = {
|
||||||
id: asUuid(this.id),
|
id: this.id ? asUuid(this.id) : undefined,
|
||||||
organizationId: this.organizationId ? asUuid(this.organizationId) : undefined,
|
organizationId: this.organizationId ? asUuid(this.organizationId) : undefined,
|
||||||
folderId: this.folderId ? asUuid(this.folderId) : undefined,
|
folderId: this.folderId ? asUuid(this.folderId) : undefined,
|
||||||
collectionIds: this.collectionIds ? this.collectionIds.map(asUuid) : ([] as any),
|
collectionIds: this.collectionIds ? this.collectionIds.map(asUuid) : ([] as any),
|
||||||
|
|||||||
@@ -325,11 +325,11 @@ export class CipherView implements View, InitializerMetadata {
|
|||||||
name: this.name ?? "",
|
name: this.name ?? "",
|
||||||
notes: this.notes,
|
notes: this.notes,
|
||||||
type: this.type ?? CipherType.Login,
|
type: this.type ?? CipherType.Login,
|
||||||
favorite: this.favorite,
|
favorite: this.favorite ?? false,
|
||||||
organizationUseTotp: this.organizationUseTotp,
|
organizationUseTotp: this.organizationUseTotp ?? false,
|
||||||
permissions: this.permissions?.toSdkCipherPermissions(),
|
permissions: this.permissions?.toSdkCipherPermissions(),
|
||||||
edit: this.edit,
|
edit: this.edit ?? true,
|
||||||
viewPassword: this.viewPassword,
|
viewPassword: this.viewPassword ?? true,
|
||||||
localData: toSdkLocalData(this.localData),
|
localData: toSdkLocalData(this.localData),
|
||||||
attachments: this.attachments?.map((a) => a.toSdkAttachmentView()),
|
attachments: this.attachments?.map((a) => a.toSdkAttachmentView()),
|
||||||
fields: this.fields?.map((f) => f.toSdkFieldView()),
|
fields: this.fields?.map((f) => f.toSdkFieldView()),
|
||||||
|
|||||||
Reference in New Issue
Block a user