🐛 Fix send notification from api missing created at / updated at

This commit is contained in:
LittleSheep 2025-06-01 01:34:46 +08:00
parent 6dc0f523e0
commit 7040b236e9

View File

@ -4,6 +4,7 @@ using DysonNetwork.Sphere.Permission;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using NodaTime;
namespace DysonNetwork.Sphere.Account; namespace DysonNetwork.Sphere.Account;
@ -118,6 +119,8 @@ public class NotificationController(AppDatabase db, NotificationService nty) : C
await nty.BroadcastNotification( await nty.BroadcastNotification(
new Notification new Notification
{ {
CreatedAt = SystemClock.Instance.GetCurrentInstant(),
UpdatedAt = SystemClock.Instance.GetCurrentInstant(),
Topic = request.Topic, Topic = request.Topic,
Title = request.Title, Title = request.Title,
Subtitle = request.Subtitle, Subtitle = request.Subtitle,
@ -147,6 +150,8 @@ public class NotificationController(AppDatabase db, NotificationService nty) : C
await nty.SendNotificationBatch( await nty.SendNotificationBatch(
new Notification new Notification
{ {
CreatedAt = SystemClock.Instance.GetCurrentInstant(),
UpdatedAt = SystemClock.Instance.GetCurrentInstant(),
Topic = request.Topic, Topic = request.Topic,
Title = request.Title, Title = request.Title,
Subtitle = request.Subtitle, Subtitle = request.Subtitle,