This commit is contained in:
mertalev 2025-05-06 14:55:00 -04:00
parent 606d4b66d0
commit 4174575785
No known key found for this signature in database
GPG Key ID: DF6ABC77AAD98C95
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')

View File

@ -79,7 +79,7 @@ export const toResponseDto = (...timelineAsset: TimelineAsset[]) => {
bucketAssets.ownerId.push(asset.ownerId);
bucketAssets.projectionType.push(asset.projectionType!);
bucketAssets.ratio.push(asset.ratio);
bucketAssets.stack?.push(asset.stack ? [asset.stack.id, asset.stack.assetCount] : null);
bucketAssets.stack?.push(asset.stack ? [asset.stack.id, asset.stack.assetCount.toString()] : null);
bucketAssets.thumbhash.push(asset.thumbhash!);
}