This commit is contained in:
mertalev
2025-05-06 14:55:00 -04:00
parent 606d4b66d0
commit 4174575785
3 changed files with 3 additions and 3 deletions

View File

@@ -335,7 +335,7 @@ with
coalesce(array_agg("ratio"), '{}') as "ratio",
coalesce(array_agg("status"), '{}') as "status",
coalesce(array_agg("thumbhash"), '{}') as "thumbhash",
coalesce(array_agg("stack"), '{}') as "stack"
coalesce(json_agg("stack"), '[]') as "stack"
from
"cte"
)

View File

@@ -692,7 +692,7 @@ export class AssetRepository {
eb.fn.coalesce(eb.fn('array_agg', ['thumbhash']), sql.lit('{}')).as('thumbhash'),
])
.$if(!!options.withStacked, (qb) =>
qb.select((eb) => eb.fn.coalesce(eb.fn('array_agg', ['stack']), sql.lit('{}')).as('stack')),
qb.select((eb) => eb.fn.coalesce(eb.fn('json_agg', ['stack']), sql.lit('[]')).as('stack')),
),
)
.selectFrom('agg')