mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-08 18:54:22 -04:00
Fix ?with=studios
invalid date formats
This commit is contained in:
parent
aa342cfbd3
commit
a697ffb524
@ -121,7 +121,7 @@ const showRelations = {
|
|||||||
.as("translations");
|
.as("translations");
|
||||||
},
|
},
|
||||||
studios: ({ languages }: { languages: string[] }) => {
|
studios: ({ languages }: { languages: string[] }) => {
|
||||||
const { pk: _, ...studioCol } = getColumns(studios);
|
const { pk: _, createdAt, updatedAt, ...studioCol } = getColumns(studios);
|
||||||
const studioTransQ = db
|
const studioTransQ = db
|
||||||
.selectDistinctOn([studioTranslations.pk])
|
.selectDistinctOn([studioTranslations.pk])
|
||||||
.from(studioTranslations)
|
.from(studioTranslations)
|
||||||
@ -135,7 +135,14 @@ const showRelations = {
|
|||||||
return db
|
return db
|
||||||
.select({
|
.select({
|
||||||
json: coalesce(
|
json: coalesce(
|
||||||
jsonbAgg(jsonbBuildObject<Studio>({ ...studioTrans, ...studioCol })),
|
jsonbAgg(
|
||||||
|
jsonbBuildObject<Studio>({
|
||||||
|
...studioTrans,
|
||||||
|
...studioCol,
|
||||||
|
createdAt: sql`to_char(${createdAt}, 'YYYY-MM-DD"T"HH24:MI:SS"Z"')`,
|
||||||
|
updatedAt: sql`to_char(${updatedAt}, 'YYYY-MM-DD"T"HH24:MI:SS"Z"')`,
|
||||||
|
}),
|
||||||
|
),
|
||||||
sql`'[]'::jsonb`,
|
sql`'[]'::jsonb`,
|
||||||
).as("json"),
|
).as("json"),
|
||||||
})
|
})
|
||||||
|
@ -109,6 +109,7 @@ export const queryFn = async <Parser extends z.ZodTypeAny>(context: {
|
|||||||
" Parse error: ",
|
" Parse error: ",
|
||||||
parsed.error,
|
parsed.error,
|
||||||
);
|
);
|
||||||
|
console.log(parsed.error.issues);
|
||||||
throw {
|
throw {
|
||||||
status: "parse",
|
status: "parse",
|
||||||
message:
|
message:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user