mirror of
https://github.com/bitwarden/server.git
synced 2024-11-22 12:15:36 +01:00
[Soft Delete] - fix Upsert calls based on cipher supertype
This commit is contained in:
parent
b106fd22fb
commit
4defd13395
@ -679,7 +679,14 @@ namespace Bit.Core.Services
|
||||
|
||||
cipher.DeletedDate = cipher.RevisionDate = DateTime.UtcNow;
|
||||
|
||||
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;
|
||||
|
||||
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