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 {
|
export interface ScyllaDriveFile {
|
||||||
id: string;
|
id: string;
|
||||||
type: string;
|
type: string;
|
||||||
createdAt: Date;
|
createdAt: Date | string;
|
||||||
name: string;
|
name: string;
|
||||||
comment: string | null;
|
comment: string | null;
|
||||||
blurhash: string | null;
|
blurhash: string | null;
|
||||||
|
|
|
@ -327,7 +327,10 @@ export const NoteRepository = db.getRepository(Note).extend({
|
||||||
? (note as ScyllaNote).files.map((file) => ({
|
? (note as ScyllaNote).files.map((file) => ({
|
||||||
...file,
|
...file,
|
||||||
thumbnailUrl: getScyllaDrivePublicUrl(file, true),
|
thumbnailUrl: getScyllaDrivePublicUrl(file, true),
|
||||||
createdAt: file.createdAt.toISOString(),
|
createdAt: (typeof file.createdAt === "string"
|
||||||
|
? new Date(file.createdAt)
|
||||||
|
: file.createdAt
|
||||||
|
).toISOString(),
|
||||||
properties: {
|
properties: {
|
||||||
width: file.width ?? undefined,
|
width: file.width ?? undefined,
|
||||||
height: file.height ?? undefined,
|
height: file.height ?? undefined,
|
||||||
|
|
Loading…
Reference in a new issue