backend: fix make emoji categories and names case insensitive

This commit is contained in:
fly_mc 2024-11-20 00:32:08 +08:00
parent 75d49c9262
commit a131e4d9e9

View file

@ -50,11 +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.createQueryBuilder()
.where('host IS NULL')
.orderBy('LOWER(category)', 'ASC')
.orderBy('LOWER(name)', 'ASC')
.getMany()
const emojis = await this.emojisRepository.createQueryBuilder('emoji')
.where('emoji.host IS NULL')
.orderBy('LOWER(emoji.category)', 'ASC')
.addOrderBy('LOWER(emoji.name)', 'ASC')
.getMany();
return {
emojis: await this.emojiEntityService.packSimpleMany(emojis),