Merge ce31a70d06 into 5ade152bc5
commit
d07f21c11d
|
|
@ -464,7 +464,9 @@ export class AssetRepository {
|
|||
eb
|
||||
.selectFrom('asset as stacked')
|
||||
.selectAll('stack')
|
||||
.select((eb) => eb.fn('array_agg', [eb.table('stacked')]).as('assets'))
|
||||
.select(
|
||||
sql<unknown[]>`array_agg(to_json(stacked) ORDER BY stacked."fileCreatedAt" ASC)`.as('assets'),
|
||||
)
|
||||
.whereRef('stacked.stackId', '=', 'stack.id')
|
||||
.whereRef('stacked.id', '!=', 'stack.primaryAssetId')
|
||||
.where('stacked.deletedAt', 'is', null)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ const withAssets = (eb: ExpressionBuilder<DB, 'stack'>, withTags = false) => {
|
|||
.select((eb) => eb.fn.toJson('exifInfo').as('exifInfo'))
|
||||
.where('asset.deletedAt', 'is', null)
|
||||
.whereRef('asset.stackId', '=', 'stack.id')
|
||||
.$call(withDefaultVisibility),
|
||||
.$call(withDefaultVisibility)
|
||||
.orderBy('asset.fileCreatedAt', 'asc'),
|
||||
).as('assets');
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue