From fd563fc5f68ed33007e73db751130fc3de7a339b Mon Sep 17 00:00:00 2001 From: naskya Date: Thu, 6 Jun 2024 10:34:53 +0900 Subject: [PATCH] hotfix for type error --- packages/backend/src/models/repositories/note.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index e981c933d3..062973a741 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -202,7 +202,13 @@ export const NoteRepository = db.getRepository(Note).extend({ const packed: Packed<"Note"> = await awaitAll({ id: note.id, createdAt: note.createdAt.toISOString(), - scheduledAt: note.scheduledAt, + // FIXME: note.scheduledAt should be a `Date` + scheduledAt: + note.scheduledAt == null + ? undefined + : typeof note.scheduledAt === "string" + ? note.scheduledAt + : note.scheduledAt?.toISOString(), userId: note.userId, user: Users.pack(note.user ?? note.userId, me, { detail: false,