1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-30 15:42:48 -05:00

[SG-378] Get and send collectionIds when a cipher is updated (#2066)

* Get and send collectionIds when a cipher is updated

* Make Put method parameters Guids instead of strings
This commit is contained in:
Robyn MacCallum
2022-06-21 08:25:54 -04:00
committed by GitHub
parent a94823f648
commit f2a02e040c
2 changed files with 10 additions and 16 deletions

View File

@ -98,17 +98,13 @@ namespace Bit.Core.Services
}
else
{
if (collectionIds != null)
{
throw new ArgumentException("Cannot create cipher with collection ids at the same time.");
}
ValidateCipherLastKnownRevisionDateAsync(cipher, lastKnownRevisionDate);
cipher.RevisionDate = DateTime.UtcNow;
await _cipherRepository.ReplaceAsync(cipher);
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_Updated);
// push
await _pushService.PushSyncCipherUpdateAsync(cipher, null);
await _pushService.PushSyncCipherUpdateAsync(cipher, collectionIds);
}
}
@ -156,17 +152,13 @@ namespace Bit.Core.Services
}
else
{
if (collectionIds != null)
{
throw new ArgumentException("Cannot create cipher with collection ids at the same time.");
}
ValidateCipherLastKnownRevisionDateAsync(cipher, lastKnownRevisionDate);
cipher.RevisionDate = DateTime.UtcNow;
await _cipherRepository.ReplaceAsync(cipher);
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_Updated);
// push
await _pushService.PushSyncCipherUpdateAsync(cipher, null);
await _pushService.PushSyncCipherUpdateAsync(cipher, collectionIds);
}
}