diff --git a/src/pages/article/[slug].tsx b/src/pages/article/[slug].tsx index 93f05d5..68d4390 100644 --- a/src/pages/article/[slug].tsx +++ b/src/pages/article/[slug].tsx @@ -6,14 +6,22 @@ import api from '@/services/unbody.service' import { ArticlePostData } from '@/types/data.types' import { SEO } from '@/components/SEO' import { ArticleProvider } from '@/context/article.context' +import { useRouter } from 'next/router' type ArticleProps = { data: ArticlePostData errors: string | null + why?: string } -const ArticlePage = ({ data, errors }: ArticleProps) => { +const ArticlePage = ({ data, errors, why }: ArticleProps) => { + const { + query: { slug }, + } = useRouter() + console.log(typeof data, slug, why) + if (!data) return null if (errors) return