mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 22:30:23 +00:00
This commit is contained in:
parent
6773165c72
commit
849097198b
@ -33,9 +33,11 @@ const Votes:NextPage<VotesProps> = ({ data }) => {
|
|||||||
}
|
}
|
||||||
export const getServerSideProps = async (ctx:Context) => {
|
export const getServerSideProps = async (ctx:Context) => {
|
||||||
let data: BotList
|
let data: BotList
|
||||||
|
console.log(ctx.query.page)
|
||||||
if(!ctx.query.page) ctx.query.page = '1'
|
if(!ctx.query.page) ctx.query.page = '1'
|
||||||
const validate = await PageCount.validate(ctx.query.page).then(el => el).catch(() => null)
|
const validate = await PageCount.validate(ctx.query.page).then(el => el).catch(() => null)
|
||||||
if(!validate) data = null
|
console.log(validate)
|
||||||
|
if(!validate || isNaN(Number(ctx.query.page))) data = null
|
||||||
else data = await Query.get.list.votes.load(Number(ctx.query.page))
|
else data = await Query.get.list.votes.load(Number(ctx.query.page))
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user