Gestito notificationData nelle notifiche push
This commit is contained in:
@@ -4,6 +4,9 @@ namespace salesbook.Shared.Core.Dto;
|
||||
|
||||
public class NotificationDataDTO
|
||||
{
|
||||
[JsonPropertyName("notificationId")]
|
||||
public string? NotificationId { get; set; }
|
||||
|
||||
[JsonPropertyName("activityId")]
|
||||
public string? ActivityId { get; set; }
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace salesbook.Shared.Core.Interface.IntegryApi;
|
||||
|
||||
public interface IIntegryNotificationRestClient
|
||||
{
|
||||
Task<List<WtbNotification>> Get();
|
||||
Task<List<WtbNotification>?> Get();
|
||||
Task<WtbNotification> MarkAsRead(long id);
|
||||
Task Delete(long id);
|
||||
Task DeleteAll();
|
||||
|
||||
@@ -10,7 +10,7 @@ public class IntegryNotificationRestClient(
|
||||
IUserSession userSession,
|
||||
IIntegryApiRestClient integryApiRestClient) : IIntegryNotificationRestClient
|
||||
{
|
||||
public Task<List<WtbNotification>> Get()
|
||||
public Task<List<WtbNotification>?> Get()
|
||||
{
|
||||
var queryParams = new Dictionary<string, object>
|
||||
{
|
||||
@@ -18,7 +18,7 @@ public class IntegryNotificationRestClient(
|
||||
{ "forUser", userSession.User.Username }
|
||||
};
|
||||
|
||||
return integryApiRestClient.Get<List<WtbNotification>>("notification", queryParams)!;
|
||||
return integryApiRestClient.Get<List<WtbNotification>>("notification", queryParams);
|
||||
}
|
||||
|
||||
public Task<WtbNotification> MarkAsRead(long id) =>
|
||||
|
||||
@@ -12,6 +12,8 @@ public class NotificationService(
|
||||
public async Task LoadNotification()
|
||||
{
|
||||
var allNotifications = await integryNotificationRestClient.Get();
|
||||
if (allNotifications == null) return;
|
||||
|
||||
var allIds = allNotifications.Select(n => n.Id).ToHashSet();
|
||||
|
||||
Notification.ReceivedNotifications = Notification.ReceivedNotifications
|
||||
|
||||
Reference in New Issue
Block a user