bug fixes
This commit is contained in:
parent
2a796509c8
commit
1759f7cd8e
12 changed files with 151 additions and 48 deletions
22
Sledgemapper.Api/Handlers/SendDeleteNoteMessage.cs
Normal file
22
Sledgemapper.Api/Handlers/SendDeleteNoteMessage.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using MediatR;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Sledgemapper.Clients;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Sledgemapper.Api.Hubs;
|
||||
using Sledgemapper.Api.Notifications;
|
||||
|
||||
namespace Sledgemapper.Api.Handlers
|
||||
{
|
||||
public class SendDeleteNoteMessage : INotificationHandler<DeleteNoteNotification>
|
||||
{
|
||||
private readonly IHubContext<SledgemapperHub, ISledgemapperClient> _hub;
|
||||
|
||||
public SendDeleteNoteMessage(IHubContext<SledgemapperHub, ISledgemapperClient> hub) => _hub = hub;
|
||||
|
||||
public async Task Handle(DeleteNoteNotification notification, CancellationToken cancellationToken)
|
||||
{
|
||||
await _hub.Clients.Groups(notification.Session.SessionName).DeleteNote(notification.Note);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue