Mark all notifications read

This commit is contained in:
2025-08-14 15:33:48 +08:00
parent b04b17c8ae
commit 27e6dde7c4
3 changed files with 26 additions and 9 deletions

View File

@@ -173,6 +173,14 @@ public class PushService
);
}
public async Task MarkAllNotificationsViewed(Guid accountId)
{
var now = SystemClock.Instance.GetCurrentInstant();
await _db.Notifications
.Where(n => n.AccountId == accountId)
.ExecuteUpdateAsync(s => s.SetProperty(n => n.ViewedAt, now));
}
public async Task SendNotificationBatch(Notification notification, List<Guid> accounts, bool save = false)
{
if (save)