1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 09:02:48 -05:00

centralize type deserialization

This commit is contained in:
Kyle Spearrin
2018-08-25 17:21:42 -04:00
parent 6f7d07530a
commit f74dfb5fbb
3 changed files with 5 additions and 13 deletions

View File

@ -1,12 +1,10 @@
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Bit.Core.Models;
using Bit.Core.Utilities;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SignalR;
using Newtonsoft.Json;
namespace Bit.Notifications
{
@ -29,8 +27,7 @@ namespace Bit.Notifications
var notificationJson = await reader.ReadToEndAsync();
if(!string.IsNullOrWhiteSpace(notificationJson))
{
var notification = JsonConvert.DeserializeObject<PushNotificationData<object>>(notificationJson);
await HubHelpers.SendNotificationToHubAsync(notification.Type, notificationJson, _hubContext);
await HubHelpers.SendNotificationToHubAsync(notificationJson, _hubContext);
}
}
}