From eaad96aae30d0e1ab1ae05b5c0fef908cd002d79 Mon Sep 17 00:00:00 2001 From: piuvas <piuvas@proton.me> Date: Fri, 15 Nov 2024 13:40:53 -0300 Subject: [PATCH] edit query --- .../backend/src/server/api/endpoints/emojis.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/emojis.ts b/packages/backend/src/server/api/endpoints/emojis.ts index 46ef4eca1b..8054de3d95 100644 --- a/packages/backend/src/server/api/endpoints/emojis.ts +++ b/packages/backend/src/server/api/endpoints/emojis.ts @@ -50,16 +50,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- private emojiEntityService: EmojiEntityService, ) { super(meta, paramDef, async (ps, me) => { - const emojis = await this.emojisRepository.find({ - where: { - host: IsNull(), - }, - order: { - category: 'ASC', - name: 'ASC', - }, - }); - + const emojis = await this.emojisRepository.createQueryBuilder() + .where('host IS NULL') + .orderBy('LOWER(category)', 'ASC') + .orderBy('LOWER(name)', 'ASC') + .getMany() return { emojis: await this.emojiEntityService.packSimpleMany(emojis), }; -- GitLab