Skip to content

Commit

Permalink
fix(server): memory lane assets order (#15882)
Browse files Browse the repository at this point in the history
* fix(server): memory lane assets order

* fix: sql

* pr feedback

* sql
  • Loading branch information
alextran1502 authored Feb 3, 2025
1 parent 47f6181 commit 06f077b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/src/queries/asset.repository.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ with
and "asset_files"."type" = $6
)
and "assets"."deletedAt" is null
order by
(assets."localDateTime" at time zone 'UTC')::date desc
limit
$7
) as "a" on true
Expand Down
1 change: 1 addition & 0 deletions server/src/repositories/asset.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export class AssetRepository implements IAssetRepository {
),
)
.where('assets.deletedAt', 'is', null)
.orderBy(sql`(assets."localDateTime" at time zone 'UTC')::date`, 'desc')
.limit(20)
.as('a'),
(join) => join.onTrue(),
Expand Down

0 comments on commit 06f077b

Please sign in to comment.