merge: make emoji categories and names case insensitive. (!746)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/746

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: dakkar <dakkar@thenautilus.net>
This commit is contained in:
dakkar 2024-11-17 13:22:39 +00:00
commit 482538c7f8

View file

@ -50,16 +50,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private emojiEntityService: EmojiEntityService, private emojiEntityService: EmojiEntityService,
) { ) {
super(meta, paramDef, async (ps, me) => { super(meta, paramDef, async (ps, me) => {
const emojis = await this.emojisRepository.find({ const emojis = await this.emojisRepository.createQueryBuilder()
where: { .where('host IS NULL')
host: IsNull(), .orderBy('LOWER(category)', 'ASC')
}, .orderBy('LOWER(name)', 'ASC')
order: { .getMany()
category: 'ASC',
name: 'ASC',
},
});
return { return {
emojis: await this.emojiEntityService.packSimpleMany(emojis), emojis: await this.emojiEntityService.packSimpleMany(emojis),
}; };