edit query

This commit is contained in:
piuvas 2024-11-15 13:40:53 -03:00
parent e783359aca
commit eaad96aae3
No known key found for this signature in database
GPG key ID: 82743F52454C621D

View file

@ -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),
};