mirror of
https://github.com/bitwarden/server.git
synced 2024-11-25 12:45:18 +01:00
EF repos: fix attachments update (#2374)
* fix attachments update * Update src/Infrastructure.EntityFramework/Repositories/CipherRepository.cs Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com> * Update CipherRepository.cs Co-authored-by: Justin Baur <19896123+justindbaur@users.noreply.github.com>
This commit is contained in:
parent
0a01051d83
commit
52b50ef0e9
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user