From 07d6a30fb5444d16989d9c25516675f6772300dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Thu, 1 Feb 2024 12:34:54 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend/admin/emoji/list):=20=E6=A4=9C?= =?UTF-8?q?=E7=B4=A2=E3=81=8C=E6=AD=A3=E5=B8=B8=E3=81=AB=E5=8B=95=E4=BD=9C?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(MisskeyIO#400)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/api/endpoints/admin/emoji/list.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts index f51cc1208..7955f8bab 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/list.ts @@ -96,11 +96,11 @@ export default class extends Endpoint { // 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();