Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit 7fd2fd2

Browse files
committed
Fix fallback for 404
1 parent d92e679 commit 7fd2fd2

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

api/wordpress/_global/getPostTypeStaticProps.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ export default async function getPostTypeStaticProps(
4545

4646
/* -- Fallback: return error if params missing. -- */
4747
if (!params) {
48-
return {
49-
props: {
50-
...sharedProps,
51-
error: true,
52-
errorMessage: 'An unexpected error occurred'
53-
},
54-
revalidate
55-
}
48+
return '404' !== postType
49+
? {
50+
notFound: true
51+
}
52+
: {
53+
props: {
54+
...sharedProps
55+
},
56+
revalidate
57+
}
5658
}
5759

5860
/* -- Handle dynamic archive display. -- */

0 commit comments

Comments
 (0)