feat: add ordering by file creation date in asset and stack repositories
parent
33cdea88aa
commit
52887e47f6
|
|
@ -436,6 +436,7 @@ export class AssetRepository {
|
||||||
.whereRef('stacked.id', '!=', 'stack.primaryAssetId')
|
.whereRef('stacked.id', '!=', 'stack.primaryAssetId')
|
||||||
.where('stacked.deletedAt', 'is', null)
|
.where('stacked.deletedAt', 'is', null)
|
||||||
.where('stacked.visibility', '=', AssetVisibility.Timeline)
|
.where('stacked.visibility', '=', AssetVisibility.Timeline)
|
||||||
|
.orderBy('stacked.fileCreatedAt', 'asc')
|
||||||
.groupBy('stack.id')
|
.groupBy('stack.id')
|
||||||
.as('stacked_assets'),
|
.as('stacked_assets'),
|
||||||
(join) => join.on('stack.id', 'is not', null),
|
(join) => join.on('stack.id', 'is not', null),
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,8 @@ const withAssets = (eb: ExpressionBuilder<DB, 'stack'>, withTags = false) => {
|
||||||
.select((eb) => eb.fn.toJson('exifInfo').as('exifInfo'))
|
.select((eb) => eb.fn.toJson('exifInfo').as('exifInfo'))
|
||||||
.where('asset.deletedAt', 'is', null)
|
.where('asset.deletedAt', 'is', null)
|
||||||
.whereRef('asset.stackId', '=', 'stack.id')
|
.whereRef('asset.stackId', '=', 'stack.id')
|
||||||
.$call(withDefaultVisibility),
|
.$call(withDefaultVisibility)
|
||||||
|
.orderBy('asset.fileCreatedAt', 'asc'),
|
||||||
).as('assets');
|
).as('assets');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue