chore(server): replace usage of deprecated orderBy and remove unnecessary instruction (#19072)

* replace usage of deprecated orderBy instruction
remove unnecesarry extra order instruction
update e2e test

* rename symbols
This commit is contained in:
SGT 2025-06-13 16:18:44 -03:00 committed by GitHub
parent 5f5308631e
commit 77a362f0c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 70 additions and 8 deletions

View file

@ -179,9 +179,8 @@ export class PersonRepository {
)
.$if(!options?.closestFaceAssetId, (qb) =>
qb
.orderBy(sql`NULLIF(person.name, '') is null`, 'asc')
.orderBy((eb) => eb.fn.count('asset_faces.assetId'), 'desc')
.orderBy(sql`NULLIF(person.name, '')`, sql`asc nulls last`)
.orderBy(sql`NULLIF(person.name, '') asc nulls last`)
.orderBy('person.createdAt'),
)
.$if(!options?.withHidden, (qb) => qb.where('person.isHidden', '=', false))