mirror of
https://github.com/bitwarden/server
synced 2025-12-17 00:33:23 +00:00
centralize type deserialization
This commit is contained in:
@@ -9,10 +9,11 @@ namespace Bit.Notifications
|
||||
{
|
||||
public static class HubHelpers
|
||||
{
|
||||
public static async Task SendNotificationToHubAsync(PushType type, string notificationJson,
|
||||
public static async Task SendNotificationToHubAsync(string notificationJson,
|
||||
IHubContext<NotificationsHub> hubContext, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
switch(type)
|
||||
var notification = JsonConvert.DeserializeObject<PushNotificationData<object>>(notificationJson);
|
||||
switch(notification.Type)
|
||||
{
|
||||
case PushType.SyncCipherUpdate:
|
||||
case PushType.SyncCipherCreate:
|
||||
|
||||
Reference in New Issue
Block a user