From 145bbe47ea3668bf78550676c5c92934c5c415fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9B=90=EB=8D=94?= Date: Wed, 6 Jan 2021 13:24:32 +0900 Subject: [PATCH] feat: add type for bots endpoint --- pages/bots/[id].tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pages/bots/[id].tsx b/pages/bots/[id].tsx index 26f7551..b333eb7 100644 --- a/pages/bots/[id].tsx +++ b/pages/bots/[id].tsx @@ -1,5 +1,7 @@ -import { GetServerSideProps, NextPage } from 'next' +import { NextPage, NextPageContext } from 'next' +import { ParsedUrlQuery } from 'querystring' import Container from '../../components/Container' +import Fetch from '../../utils/Fetch' const Bots:NextPage = () => { return @@ -7,7 +9,17 @@ const Bots:NextPage = () => { } -export const getServerSideProps: GetServerSideProps = async (context) => { +export const getServerSideProps = async (ctx: Context) => { + console.log(ctx.query) return { props: { data: {} } } } -export default Bots \ No newline at end of file + +export default Bots + +interface Context extends NextPageContext { + query: Query +} + +interface Query extends ParsedUrlQuery { + id: string +} \ No newline at end of file