Skip to content

Commit ee2399f

Browse files
authored
[PM-19383] admins unable to delete attachments (#5774)
* add admin endpoint, fix typecasting error * fix typecast issue * wip * cleanup * remove ternary statement
1 parent 28467fc commit ee2399f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Core/Vault/Services/Implementations/CipherService.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,14 @@ private async Task<DeleteAttachmentResponseData> DeleteAttachmentAsync(Cipher ci
891891

892892
// Update the revision date when an attachment is deleted
893893
cipher.RevisionDate = DateTime.UtcNow;
894-
await _cipherRepository.ReplaceAsync(orgAdmin ? cipher : (CipherDetails)cipher);
894+
if (orgAdmin)
895+
{
896+
await _cipherRepository.ReplaceAsync(cipher);
897+
}
898+
else
899+
{
900+
await _cipherRepository.ReplaceAsync((CipherDetails)cipher);
901+
}
895902

896903
// push
897904
await _pushService.PushSyncCipherUpdateAsync(cipher, null);

0 commit comments

Comments
 (0)