From f9289dd6c737b6ba29330f25ac11c7edfed76ad7 Mon Sep 17 00:00:00 2001 From: skinmaker1345 Date: Mon, 4 Mar 2024 23:37:41 +0900 Subject: [PATCH] fix: set totalpage based on type --- utils/Query.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/Query.ts b/utils/Query.ts index 61c3d0f..4001629 100644 --- a/utils/Query.ts +++ b/utils/Query.ts @@ -314,7 +314,7 @@ async function getBotList(type: ListType, page = 1, query?: string): Promise await getBot(el.id)))).map((r) => ({ ...r })), currentPage: page, - totalPage: Math.ceil(Number(count) / 8), + totalPage: Math.ceil(Number(count) / (type === 'SEARCH' ? 8 : 16)), } } @@ -419,7 +419,7 @@ async function getServerList(type: ListType, page = 1, query?: string): Promise< type, data: (await Promise.all(res.map(async (el) => await getServer(el.id)))).map((r) => ({ ...r })), currentPage: page, - totalPage: Math.ceil(Number(count) / 8), + totalPage: Math.ceil(Number(count) / (type === 'SEARCH' ? 8 : 16)), } }