hotfix for type error

This commit is contained in:
naskya 2024-06-06 10:34:53 +09:00
parent a9bec190de
commit fd563fc5f6
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C

View file

@ -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,