make emoji categories and names case insensitive

This commit is contained in:
fly_mc 2024-11-19 22:58:15 +08:00
parent f61376fce8
commit 75d49c9262

View file

@ -50,15 +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),