diff --git a/packages/backend/src/db/scylla.ts b/packages/backend/src/db/scylla.ts index 1f38cee5f3..16bc68b954 100644 --- a/packages/backend/src/db/scylla.ts +++ b/packages/backend/src/db/scylla.ts @@ -140,7 +140,7 @@ export function parseScyllaNotification(row: types.Row): ScyllaNotification { export interface ScyllaDriveFile { id: string; type: string; - createdAt: Date; + createdAt: Date | string; name: string; comment: string | null; blurhash: string | null; diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index 7744128507..a65df2b582 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -327,7 +327,10 @@ export const NoteRepository = db.getRepository(Note).extend({ ? (note as ScyllaNote).files.map((file) => ({ ...file, thumbnailUrl: getScyllaDrivePublicUrl(file, true), - createdAt: file.createdAt.toISOString(), + createdAt: (typeof file.createdAt === "string" + ? new Date(file.createdAt) + : file.createdAt + ).toISOString(), properties: { width: file.width ?? undefined, height: file.height ?? undefined,