From 7040b236e95cf706c782671cc451bb8d1cee0c37 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 1 Jun 2025 01:34:46 +0800 Subject: [PATCH] :bug: Fix send notification from api missing created at / updated at --- DysonNetwork.Sphere/Account/NotificationController.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DysonNetwork.Sphere/Account/NotificationController.cs b/DysonNetwork.Sphere/Account/NotificationController.cs index 8036cfd..0e18633 100644 --- a/DysonNetwork.Sphere/Account/NotificationController.cs +++ b/DysonNetwork.Sphere/Account/NotificationController.cs @@ -4,6 +4,7 @@ using DysonNetwork.Sphere.Permission; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; +using NodaTime; namespace DysonNetwork.Sphere.Account; @@ -118,6 +119,8 @@ public class NotificationController(AppDatabase db, NotificationService nty) : C await nty.BroadcastNotification( new Notification { + CreatedAt = SystemClock.Instance.GetCurrentInstant(), + UpdatedAt = SystemClock.Instance.GetCurrentInstant(), Topic = request.Topic, Title = request.Title, Subtitle = request.Subtitle, @@ -147,6 +150,8 @@ public class NotificationController(AppDatabase db, NotificationService nty) : C await nty.SendNotificationBatch( new Notification { + CreatedAt = SystemClock.Instance.GetCurrentInstant(), + UpdatedAt = SystemClock.Instance.GetCurrentInstant(), Topic = request.Topic, Title = request.Title, Subtitle = request.Subtitle,