style: import style, debug code removed

This commit is contained in:
원더 2021-01-30 14:01:20 +09:00
parent 5190f67c38
commit d23b4291d1

View File

@ -4,7 +4,7 @@ import dynamic from 'next/dynamic'
import { ParsedUrlQuery } from 'querystring' import { ParsedUrlQuery } from 'querystring'
import { BotList } from '@types' import { BotList } from '@types'
import * as Query from '@utils/Query' import { get }from '@utils/Query'
import NotFound from '../404' import NotFound from '../404'
import { PageCount } from '@utils/Yup' import { PageCount } from '@utils/Yup'
@ -34,12 +34,10 @@ 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)
console.log(validate)
if(!validate || isNaN(Number(ctx.query.page))) data = null if(!validate || isNaN(Number(ctx.query.page))) data = null
else data = await Query.get.list.votes.load(Number(ctx.query.page)) else data = await get.list.votes.load(Number(ctx.query.page))
return { return {
props: { props: {
data data