From ee2399f5008fc68bec455b89d2d3248a6f507c63 Mon Sep 17 00:00:00 2001 From: Brandon Treston Date: Tue, 6 May 2025 15:36:28 -0400 Subject: [PATCH] [PM-19383] admins unable to delete attachments (#5774) * add admin endpoint, fix typecasting error * fix typecast issue * wip * cleanup * remove ternary statement --- src/Core/Vault/Services/Implementations/CipherService.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Core/Vault/Services/Implementations/CipherService.cs b/src/Core/Vault/Services/Implementations/CipherService.cs index 73212ab72e..f81e404db8 100644 --- a/src/Core/Vault/Services/Implementations/CipherService.cs +++ b/src/Core/Vault/Services/Implementations/CipherService.cs @@ -891,7 +891,14 @@ public class CipherService : ICipherService // Update the revision date when an attachment is deleted cipher.RevisionDate = DateTime.UtcNow; - await _cipherRepository.ReplaceAsync(orgAdmin ? cipher : (CipherDetails)cipher); + if (orgAdmin) + { + await _cipherRepository.ReplaceAsync(cipher); + } + else + { + await _cipherRepository.ReplaceAsync((CipherDetails)cipher); + } // push await _pushService.PushSyncCipherUpdateAsync(cipher, null);