From 1d3c8253981fba2d431df2f5cc12dd78b21d37bc Mon Sep 17 00:00:00 2001 From: Marie Date: Mon, 4 Nov 2024 11:22:37 +0100 Subject: upd: add notification for when scheduled note gets posted --- packages/backend/src/models/Notification.ts | 5 +++++ .../backend/src/models/json-schema/notification.ts | 25 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) (limited to 'packages/backend/src/models') diff --git a/packages/backend/src/models/Notification.ts b/packages/backend/src/models/Notification.ts index 5003e02d96..53003a0a5a 100644 --- a/packages/backend/src/models/Notification.ts +++ b/packages/backend/src/models/Notification.ts @@ -127,6 +127,11 @@ export type MiNotification = { id: string; createdAt: string; reason: string; +} | { + type: 'scheduledNotePosted'; + id: string; + createdAt: string; + noteId: MiNote['id']; }; export type MiGroupedNotification = MiNotification | { diff --git a/packages/backend/src/models/json-schema/notification.ts b/packages/backend/src/models/json-schema/notification.ts index 69bd9531ec..26498e3e9d 100644 --- a/packages/backend/src/models/json-schema/notification.ts +++ b/packages/backend/src/models/json-schema/notification.ts @@ -383,6 +383,31 @@ export const packedNotificationSchema = { optional: false, nullable: false, }, }, + }, { + type: 'object', + properties: { + ...baseSchema.properties, + type: { + type: 'string', + optional: false, nullable: false, + enum: ['scheduledNotePosted'], + }, + user: { + type: 'object', + ref: 'UserLite', + optional: false, nullable: false, + }, + userId: { + type: 'string', + optional: false, nullable: false, + format: 'id', + }, + note: { + type: 'object', + ref: 'Note', + optional: false, nullable: false, + }, + }, }, { type: 'object', properties: { -- cgit v1.2.3-freya