fix: file createdAt can be string
This commit is contained in:
parent
970bf99c09
commit
1606163ad7
2 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue