From 491789bd5a6454faed8e47f4c948ffbc05144c5b Mon Sep 17 00:00:00 2001 From: Maciej Zieniuk Date: Thu, 24 Oct 2024 13:05:11 +0100 Subject: [PATCH] PM-10600: Required attribute, organization group for push notification fix --- src/Core/Models/Api/Request/PushSendRequestModel.cs | 4 ++-- src/Notifications/NotificationsHub.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Core/Models/Api/Request/PushSendRequestModel.cs b/src/Core/Models/Api/Request/PushSendRequestModel.cs index 50890cb277..7247e6d25f 100644 --- a/src/Core/Models/Api/Request/PushSendRequestModel.cs +++ b/src/Core/Models/Api/Request/PushSendRequestModel.cs @@ -10,8 +10,8 @@ public class PushSendRequestModel : IValidatableObject public string? OrganizationId { get; set; } public string? DeviceId { get; set; } public string? Identifier { get; set; } - [Required] public PushType Type { get; set; } - [Required] public object Payload { get; set; } = null!; + public required PushType Type { get; set; } + public required object Payload { get; set; } public ClientType? ClientType { get; set; } public IEnumerable Validate(ValidationContext validationContext) diff --git a/src/Notifications/NotificationsHub.cs b/src/Notifications/NotificationsHub.cs index f7e6cc06c4..27cd19c0a0 100644 --- a/src/Notifications/NotificationsHub.cs +++ b/src/Notifications/NotificationsHub.cs @@ -80,7 +80,7 @@ public class NotificationsHub : Microsoft.AspNetCore.SignalR.Hub public static string GetOrganizationGroup(Guid organizationId, ClientType? clientType = null) { - return clientType is not ClientType.All + return clientType is null or ClientType.All ? $"Organization_{organizationId}" : $"OrganizationClientType_{organizationId}_{clientType}"; }