|
|
@ -9,8 +9,6 @@ import styles from './style.module.css'
|
|
|
|
Category.getInitialProps = async function({ctx: {axios, query: {slug}}}){
|
|
|
|
Category.getInitialProps = async function({ctx: {axios, query: {slug}}}){
|
|
|
|
const {data: category} = await axios.get(`/api/categories/by-slug/${slug}`)
|
|
|
|
const {data: category} = await axios.get(`/api/categories/by-slug/${slug}`)
|
|
|
|
|
|
|
|
|
|
|
|
console.log(category)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!category) {
|
|
|
|
if(!category) {
|
|
|
|
const err = new Error("Not found")
|
|
|
|
const err = new Error("Not found")
|
|
|
|
err.status = 404
|
|
|
|
err.status = 404
|
|
|
|