diff --git a/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveDocStatusHandler.cs b/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveDocStatusHandler.cs index 1e674973..2a1798e4 100644 --- a/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveDocStatusHandler.cs +++ b/EnvelopeGenerator.Application/Common/Notifications/RemoveSignature/Handlers/RemoveDocStatusHandler.cs @@ -25,8 +25,16 @@ public class RemoveDocStatusHandler : INotificationHandler /// /// - public async Task Handle(RemoveSignatureNotification notification, CancellationToken cancel) + public Task Handle(RemoveSignatureNotification notification, CancellationToken cancel) { - await _repo.DeleteAsync(s => s.Envelope!.Uuid == notification.EnvelopeUuid, cancel); + return _repo.DeleteAsync(statuses => + { + statuses = statuses.Where(status => status.Envelope!.Uuid == notification.EnvelopeUuid); + + if (notification.ReceiverSignature is string signature) + statuses = statuses.Where(status => status.Receiver!.Signature == signature); + + return statuses; + }, cancel); } } \ No newline at end of file