404 on nonexistant sub

This commit is contained in:
keyan 2022-03-03 16:18:16 -06:00
parent 1b84f76a27
commit 2afd1c437b
4 changed files with 4 additions and 4 deletions

View File

@ -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 (

View File

@ -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 } }) {

View File

@ -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 } } }) {

View File

@ -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()