feat: add type definition to signal recipients

follows more the notifications way of setting recipients and is more
future proof

Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
Heikki Hellgren
2024-03-13 13:10:55 +02:00
parent b76d0cd4f9
commit 6c1547a4fb
9 changed files with 41 additions and 18 deletions
@@ -286,7 +286,7 @@ export async function createRouter(
if (signals) {
await signals.publish<NotificationReadSignal>({
recipients: [user],
recipients: { type: 'user', entityRefs: [user] },
message: { action: 'notification_read', notification_ids: ids },
channel: 'notifications',
});
@@ -296,7 +296,7 @@ export async function createRouter(
if (signals) {
await signals.publish<NotificationReadSignal>({
recipients: [user],
recipients: { type: 'user', entityRefs: [user] },
message: { action: 'notification_unread', notification_ids: ids },
channel: 'notifications',
});
@@ -400,7 +400,7 @@ export async function createRouter(
if (signals) {
await signals.publish<NewNotificationSignal>({
recipients: user,
recipients: { type: 'user', entityRefs: [user] },
message: {
action: 'new_notification',
notification_id: ret.id,