mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
fix: set totalpage based on type
This commit is contained in:
parent
ad90f8d699
commit
f9289dd6c7
@ -314,7 +314,7 @@ async function getBotList(type: ListType, page = 1, query?: string): Promise<Lis
|
|||||||
type,
|
type,
|
||||||
data: (await Promise.all(res.map(async (el) => await getBot(el.id)))).map((r) => ({ ...r })),
|
data: (await Promise.all(res.map(async (el) => await getBot(el.id)))).map((r) => ({ ...r })),
|
||||||
currentPage: page,
|
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,
|
type,
|
||||||
data: (await Promise.all(res.map(async (el) => await getServer(el.id)))).map((r) => ({ ...r })),
|
data: (await Promise.all(res.map(async (el) => await getServer(el.id)))).map((r) => ({ ...r })),
|
||||||
currentPage: page,
|
currentPage: page,
|
||||||
totalPage: Math.ceil(Number(count) / 8),
|
totalPage: Math.ceil(Number(count) / (type === 'SEARCH' ? 8 : 16)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user