mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
Merge pull request #693 from bitwarden/soft-delete-fix
[Soft Delete] - fix Upsert calls based on cipher supertype
This commit is contained in:
commit
4b5e708ea3
@ -679,7 +679,14 @@ namespace Bit.Core.Services
|
||||
|
||||
cipher.DeletedDate = cipher.RevisionDate = DateTime.UtcNow;
|
||||
|
||||
await _cipherRepository.UpsertAsync(cipher);
|
||||
if (cipher is CipherDetails details)
|
||||
{
|
||||
await _cipherRepository.UpsertAsync(details);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _cipherRepository.UpsertAsync(cipher);
|
||||
}
|
||||
await _eventService.LogCipherEventAsync(cipher, EventType.Cipher_SoftDeleted);
|
||||
|
||||
// push
|
||||
@ -721,7 +728,14 @@ namespace Bit.Core.Services
|
||||
cipher.DeletedDate = null;
|
||||
cipher.RevisionDate = DateTime.UtcNow;
|
||||
|
||||
await _cipherRepository.UpsertAsync(cipher);
|
||||
if (cipher is CipherDetails details)
|
||||
{
|
||||
await _cipherRepository.UpsertAsync(details);
|
||||
}
|
||||
else
|
||||
{
|
||||
await _cipherRepository.UpsertAsync(cipher);
|
||||
}
|
||||
await _eventService.LogCipherEventAsync(cipher, EventType.Cipher_Restored);
|
||||
|
||||
// push
|
||||
|
Loading…
Reference in New Issue
Block a user