Skip to content

Commit

Permalink
fix: set totalpage based on type
Browse files Browse the repository at this point in the history
  • Loading branch information
skinmaker1345 committed Mar 4, 2024
1 parent ad90f8d commit f9289dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/Query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ async function getBotList(type: ListType, page = 1, query?: string): Promise<Lis
type,
data: (await Promise.all(res.map(async (el) => await getBot(el.id)))).map((r) => ({ ...r })),
currentPage: page,
totalPage: Math.ceil(Number(count) / 8),
totalPage: Math.ceil(Number(count) / (type === 'SEARCH' ? 8 : 16)),
}
}

Expand Down Expand Up @@ -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)),
}
}

Expand Down

0 comments on commit f9289dd

Please sign in to comment.