fix(server): sort un-named faces in query (#3662)

This commit is contained in:
shalong-tanwen
2023-08-14 21:39:26 +05:30
committed by GitHub
parent f55c80eadf
commit b1b215f083
2 changed files with 2 additions and 3 deletions

View File

@@ -56,6 +56,7 @@ export class PersonRepository implements IPersonRepository {
.leftJoin('person.faces', 'face')
.where('person.ownerId = :userId', { userId })
.orderBy('COUNT(face.assetId)', 'DESC')
.addOrderBy("NULLIF(person.name, '')", 'ASC', 'NULLS LAST')
.having('COUNT(face.assetId) >= :faces', { faces: options?.minimumFaceCount || 1 })
.groupBy('person.id')
.limit(500)