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:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user