fix(backend/admin/emoji/list): 検索が正常に動作しない問題を修正 (MisskeyIO#400)

This commit is contained in:
まっちゃとーにゅ 2024-02-01 12:34:54 +09:00 committed by GitHub
parent 5ab36f93a2
commit 07d6a30fb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -96,11 +96,11 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
// 登録名、エイリアス、カテゴリーの部分一致の検索
// TODO: クエリーで処理したいが、aliasesがarrayなので複雑になりすぎるためいったん放置
emojis = (await q.getMany())
.filter(emoji =>
emoji.name.includes(ps.query!) ||
emoji.aliases.some(a => a.includes(ps.query!)) ||
emoji.category?.includes(ps.query!))
.splice(ps.limit + 1);
.filter(emoji => emoji.name.includes(ps.query!)
|| emoji.aliases.some(a => a.includes(ps.query!))
|| emoji.category?.includes(ps.query!)
)
.slice(0, ps.limit);
}
} else {
emojis = await q.limit(ps.limit).getMany();