1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-28 14:54:50 -05:00

Revert change on EF CipherRepository (#2426)

This commit is contained in:
Rui Tomé 2022-11-21 14:25:28 +00:00 committed by GitHub
parent 68bb545353
commit d8834793b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -562,7 +562,8 @@ public class CipherRepository : Repository<Core.Entities.Cipher, Cipher, Guid>,
var attachments = string.IsNullOrWhiteSpace(cipher.Attachments) ?
new Dictionary<string, CipherAttachment.MetaData>() :
JsonConvert.DeserializeObject<Dictionary<string, CipherAttachment.MetaData>>(cipher.Attachments);
attachments.Add(attachment.AttachmentId, JsonConvert.DeserializeObject<CipherAttachment.MetaData>(attachment.AttachmentData));
var metaData = JsonConvert.DeserializeObject<CipherAttachment.MetaData>(attachment.AttachmentData);
attachments[attachment.AttachmentId] = metaData;
cipher.Attachments = JsonConvert.SerializeObject(attachments);
await dbContext.SaveChangesAsync();