From 42f3b50422a4f3793480b25989b57956a57c222f Mon Sep 17 00:00:00 2001 From: Mert <101130780+mertalev@users.noreply.github.com> Date: Thu, 20 Jun 2024 23:48:19 -0400 Subject: [PATCH] fix(server): `/places` entries sometimes not ordered alphabetically (#10514) --- server/src/queries/search.repository.sql | 2 ++ server/src/repositories/search.repository.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/queries/search.repository.sql b/server/src/queries/search.repository.sql index 987828a860..e058fc685c 100644 --- a/server/src/queries/search.repository.sql +++ b/server/src/queries/search.repository.sql @@ -405,3 +405,5 @@ FROM "assets" "asset" INNER JOIN "exif" "exif" ON "exif"."assetId" = "asset"."id" INNER JOIN cte ON asset.id = cte."assetId" +ORDER BY + exif.city diff --git a/server/src/repositories/search.repository.ts b/server/src/repositories/search.repository.ts index 2637fffabe..a4c7edab91 100644 --- a/server/src/repositories/search.repository.ts +++ b/server/src/repositories/search.repository.ts @@ -52,7 +52,7 @@ export class SearchRepository implements ISearchRepository { .innerJoinAndSelect('asset.exifInfo', 'exif') .withDeleted() .getQuery() + - ' INNER JOIN cte ON asset.id = cte."assetId"'; + ' INNER JOIN cte ON asset.id = cte."assetId" ORDER BY exif.city'; } async init(modelName: string): Promise {