404 on nonexistant sub
This commit is contained in:
parent
1b84f76a27
commit
2afd1c437b
|
@ -3,7 +3,7 @@ import Items from '../../../components/items'
|
|||
import Layout from '../../../components/layout'
|
||||
import { SUB_ITEMS } from '../../../fragments/subs'
|
||||
|
||||
export const getServerSideProps = getGetServerSideProps(SUB_ITEMS)
|
||||
export const getServerSideProps = getGetServerSideProps(SUB_ITEMS, null, 'sub')
|
||||
|
||||
export default function Sub ({ data: { sub: { name }, items: { items, cursor } } }) {
|
||||
return (
|
||||
|
|
|
@ -3,7 +3,7 @@ import { SUB } from '../../../fragments/subs'
|
|||
import LayoutCenter from '../../../components/layout-center'
|
||||
import JobForm from '../../../components/job-form'
|
||||
|
||||
export const getServerSideProps = getGetServerSideProps(SUB)
|
||||
export const getServerSideProps = getGetServerSideProps(SUB, null, 'sub')
|
||||
|
||||
// need to recent list items
|
||||
export default function Post ({ data: { sub } }) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import Layout from '../../../components/layout'
|
|||
import { SUB_ITEMS } from '../../../fragments/subs'
|
||||
|
||||
const variables = { sort: 'recent' }
|
||||
export const getServerSideProps = getGetServerSideProps(SUB_ITEMS, variables)
|
||||
export const getServerSideProps = getGetServerSideProps(SUB_ITEMS, variables, 'sub')
|
||||
|
||||
// need to recent list items
|
||||
export default function Sub ({ data: { sub: { name }, items: { items, cursor } } }) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import { useRouter } from 'next/router'
|
|||
import { SeoSearch } from '../../../components/seo'
|
||||
import { SUB_SEARCH } from '../../../fragments/subs'
|
||||
|
||||
export const getServerSideProps = getGetServerSideProps(SUB_SEARCH, null, null, 'q')
|
||||
export const getServerSideProps = getGetServerSideProps(SUB_SEARCH, null, 'sub', 'q')
|
||||
|
||||
export default function Index ({ data: { sub: { name }, search: { items, cursor } } }) {
|
||||
const router = useRouter()
|
||||
|
|
Loading…
Reference in New Issue