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

Commit 0701aeb

Browse files
committed
Update comments for clarity
1 parent 506386b commit 0701aeb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

api/wordpress/_global/getPostTypeStaticProps.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default async function getPostTypeStaticProps(
3030
}
3131
}
3232

33-
// Check for Frontend-only routes.
33+
/* -- Handle Frontend-only routes. -- */
3434
if (Object.keys(frontendPageSeo).includes(postType)) {
3535
const {apolloClient, ...routeData} = await getFrontendPage(postType)
3636

@@ -43,7 +43,7 @@ export default async function getPostTypeStaticProps(
4343
})
4444
}
4545

46-
// Check for dynamic archive display.
46+
/* -- Handle dynamic archive display. -- */
4747
if (!Object.keys(params).length) {
4848
const {apolloClient, ...archiveData} = await getPostTypeArchive(postType)
4949

@@ -58,6 +58,8 @@ export default async function getPostTypeStaticProps(
5858
})
5959
}
6060

61+
/* -- Handle individual posts. -- */
62+
6163
// Handle catch-all routes.
6264
const slug = Array.isArray(params.slug) ? params.slug.join('/') : params.slug
6365

@@ -90,9 +92,8 @@ export default async function getPostTypeStaticProps(
9092
preview: isCurrentPostPreview
9193
}
9294

93-
// Custom handling for homepage.
95+
// Fallback to empty props if homepage not set in WP.
9496
if ('/' === slug && error) {
95-
// Fallback to empty props if homepage not set in WP.
9697
props.post = null
9798
props.error = false
9899
}

0 commit comments

Comments
 (0)