Gestito notificationData nelle notifiche push

This commit is contained in:
2025-09-12 17:37:36 +02:00
parent 223e74c490
commit 0f3047a2b6
10 changed files with 59 additions and 23 deletions

View File

@@ -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) =>

View File

@@ -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