mirror of
https://github.com/bitwarden/server.git
synced 2025-04-22 21:45:15 -05:00
single event for delete and share bulk operations
This commit is contained in:
parent
0f0cd3beeb
commit
675b22cc9f
@ -9,6 +9,7 @@ using Bit.Core.Exceptions;
|
|||||||
using Bit.Core.Models.Data;
|
using Bit.Core.Models.Data;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using Bit.Core.Enums;
|
||||||
|
|
||||||
namespace Bit.Core.Services
|
namespace Bit.Core.Services
|
||||||
{
|
{
|
||||||
@ -294,11 +295,9 @@ namespace Bit.Core.Services
|
|||||||
|
|
||||||
await _cipherRepository.DeleteAsync(cipherIds, deletingUserId);
|
await _cipherRepository.DeleteAsync(cipherIds, deletingUserId);
|
||||||
|
|
||||||
// TODO: move this to a single event?
|
var events = deletingCiphers.Select(c =>
|
||||||
foreach(var cipher in deletingCiphers)
|
new Tuple<Cipher, EventType, DateTime?>(c, EventType.Cipher_Deleted, null));
|
||||||
{
|
await _eventService.LogCipherEventsAsync(events);
|
||||||
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_Deleted);
|
|
||||||
}
|
|
||||||
|
|
||||||
// push
|
// push
|
||||||
await _pushService.PushSyncCiphersAsync(deletingUserId);
|
await _pushService.PushSyncCiphersAsync(deletingUserId);
|
||||||
@ -508,11 +507,9 @@ namespace Bit.Core.Services
|
|||||||
await _collectionCipherRepository.UpdateCollectionsForCiphersAsync(cipherIds, sharingUserId,
|
await _collectionCipherRepository.UpdateCollectionsForCiphersAsync(cipherIds, sharingUserId,
|
||||||
organizationId, collectionIds);
|
organizationId, collectionIds);
|
||||||
|
|
||||||
// TODO: move this to a single event?
|
var events = ciphers.Select(c =>
|
||||||
foreach(var cipher in ciphers)
|
new Tuple<Cipher, EventType, DateTime?>(c, EventType.Cipher_Shared, null));
|
||||||
{
|
await _eventService.LogCipherEventsAsync(events);
|
||||||
await _eventService.LogCipherEventAsync(cipher, Enums.EventType.Cipher_Shared);
|
|
||||||
}
|
|
||||||
|
|
||||||
// push
|
// push
|
||||||
await _pushService.PushSyncCiphersAsync(sharingUserId);
|
await _pushService.PushSyncCiphersAsync(sharingUserId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user