mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 14:30:22 +00:00
fix: handling invalid user id causing error
This commit is contained in:
parent
33a235c9f1
commit
52945d03ed
@ -20,7 +20,7 @@ const Advertisement = dynamic(() => import('@components/Advertisement'))
|
|||||||
const Tooltip = dynamic(() => import('@components/Tooltip'))
|
const Tooltip = dynamic(() => import('@components/Tooltip'))
|
||||||
|
|
||||||
const Users: NextPage<UserProps> = ({ data }) => {
|
const Users: NextPage<UserProps> = ({ data }) => {
|
||||||
if (!data.id) return <NotFound />
|
if (!data?.id) return <NotFound />
|
||||||
return (
|
return (
|
||||||
<Container paddingTop className='py-10'>
|
<Container paddingTop className='py-10'>
|
||||||
<SEO
|
<SEO
|
||||||
@ -95,7 +95,7 @@ const Users: NextPage<UserProps> = ({ data }) => {
|
|||||||
|
|
||||||
export const getServerSideProps = async (ctx: Context) => {
|
export const getServerSideProps = async (ctx: Context) => {
|
||||||
const data = await Query.get.user.load(ctx.query.id)
|
const data = await Query.get.user.load(ctx.query.id)
|
||||||
return { props: { data, date: SnowflakeUtil.deconstruct(data.id ?? '0')?.date?.toJSON() } }
|
return { props: { data, date: SnowflakeUtil.deconstruct(data?.id ?? '0')?.date?.toJSON() } }
|
||||||
}
|
}
|
||||||
|
|
||||||
interface UserProps {
|
interface UserProps {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user