mirror of
https://github.com/hotomoe/hotomoe
synced 2024-12-12 21:58:12 +09:00
fix(backend/admin/emoji/list): 検索が正常に動作しない問題を修正 (MisskeyIO#400)
This commit is contained in:
parent
5ab36f93a2
commit
07d6a30fb5
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user