1
0
Fork 0

fix(org): No order is used

This commit is contained in:
joostdecock 2023-07-21 19:15:07 +02:00
parent 9a16cccace
commit f985389236
2 changed files with 4 additions and 8 deletions

View file

@ -53,10 +53,8 @@ const BlogPage = ({ locale, slug, page }) => {
export async function getStaticProps({ params, locale }) {
const { slug } = params
// if the slug isn't present in the prebuilt order, return 404
if (order[locale].indexOf(`blog/${slug}`) === -1) {
return { notFound: true }
}
// if the slug isn't present in the prebuilt posts, return 404
if (!Object.keys(posts).includes(`blog/${slug}`)) return { notFound: true }
return {
props: {

View file

@ -56,10 +56,8 @@ const ShowcasePage = ({ locale, slug, page }) => {
export async function getStaticProps({ params, locale }) {
const { slug } = params
// if the slug isn't present in the prebuilt order, return 404
if (order[locale].indexOf(`showcase/${slug}`) === -1) {
return { notFound: true }
}
// if the slug isn't present in the prebuilt posts, return 404
if (!Object.keys(posts).includes(`showcase/${slug}`)) return { notFound: true }
return {
props: {