mirror of
https://github.com/bitwarden/server.git
synced 2025-04-20 20:45:10 -05: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;
|
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);
|
await _eventService.LogCipherEventAsync(cipher, EventType.Cipher_SoftDeleted);
|
||||||
|
|
||||||
// push
|
// push
|
||||||
@ -721,7 +728,14 @@ namespace Bit.Core.Services
|
|||||||
cipher.DeletedDate = null;
|
cipher.DeletedDate = null;
|
||||||
cipher.RevisionDate = DateTime.UtcNow;
|
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);
|
await _eventService.LogCipherEventAsync(cipher, EventType.Cipher_Restored);
|
||||||
|
|
||||||
// push
|
// push
|
||||||
|
Loading…
x
Reference in New Issue
Block a user