fix(server): use fileCreatedAt in buckets (#4354)

This commit is contained in:
Jonathan Jogenfors
2023-10-05 15:26:42 +02:00
committed by GitHub
parent beb92e8ffb
commit 81009c17bf
2 changed files with 2 additions and 1 deletions

View File

@@ -474,7 +474,7 @@ export class AssetRepository implements IAssetRepository {
getByTimeBucket(timeBucket: string, options: TimeBucketOptions): Promise<AssetEntity[]> {
const truncateValue = truncateMap[options.size];
return this.getBuilder(options)
.andWhere(`date_trunc('${truncateValue}', "localDateTime") = :timeBucket`, { timeBucket })
.andWhere(`date_trunc('${truncateValue}', "fileCreatedAt") = :timeBucket`, { timeBucket })
.orderBy(`date_trunc('day', "localDateTime")`, 'DESC')
.addOrderBy('asset.fileCreatedAt', 'DESC')
.getMany();

1
server/test/assets Submodule

Submodule server/test/assets added at 9e6e1bcc24