Skip to content

Commit

Permalink
fix boolean handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mertalev committed Jan 23, 2025
1 parent 50a2f61 commit 92338ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/src/repositories/asset.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,10 @@ export class AssetRepository implements IAssetRepository {
.where((eb) => eb.or([eb('assets.stackId', 'is', null), eb(eb.table('asset_stack'), 'is not', null)])),
)
.$if(!!options.userIds, (qb) => qb.where('assets.ownerId', '=', anyUuid(options.userIds!)))
.$if(!!options.isArchived, (qb) => qb.where('assets.isArchived', '=', options.isArchived!))
.$if(!!options.isFavorite, (qb) => qb.where('assets.isFavorite', '=', options.isFavorite!))
.$if(options.isArchived !== undefined, (qb) => qb.where('assets.isArchived', '=', options.isArchived!))
.$if(options.isFavorite !== undefined, (qb) => qb.where('assets.isFavorite', '=', options.isFavorite!))
.$if(!!options.assetType, (qb) => qb.where('assets.type', '=', options.assetType!))
.$if(!!options.isDuplicate, (qb) =>
.$if(options.isDuplicate !== undefined, (qb) =>
qb.where('assets.duplicateId', options.isDuplicate ? 'is not' : 'is', null),
)
.$if(!!options.tagId, (qb) => withTagId(qb, options.tagId!)),
Expand All @@ -622,7 +622,7 @@ export class AssetRepository implements IAssetRepository {
*/
.select((eb) => eb.fn.countAll().as('count'))
.groupBy('timeBucket')
.orderBy('timeBucket', 'desc')
.orderBy('timeBucket', options.order ?? 'desc')
.execute() as any as Promise<TimeBucketItem[]>
);
}
Expand Down Expand Up @@ -666,7 +666,7 @@ export class AssetRepository implements IAssetRepository {
.where('assets.deletedAt', options.isTrashed ? 'is not' : 'is', null)
.where('assets.isVisible', '=', true)
.where(truncatedDate(options.size), '=', timeBucket.replace(/^[+-]/, ''))
.orderBy('assets.localDateTime', 'desc')
.orderBy('assets.localDateTime', options.order ?? 'desc')
.execute() as any as Promise<AssetEntity[]>;
}

Expand Down

0 comments on commit 92338ee

Please sign in to comment.