Skip to content

Commit

Permalink
Add not found to validated patterns content
Browse files Browse the repository at this point in the history
Co-authored-by: Heat Hamilton <[email protected]>
  • Loading branch information
im2nguyen and heatlikeheatwave authored Jan 17, 2025
1 parent 6acd884 commit a5425c2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/pages/validated-patterns/[...tutorialSlug]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export async function getStaticProps({
}: GetStaticPropsContext<{ tutorialSlug: [string, string] }>): Promise<
{ props: ValidatedPatternsTutorialViewProps } | { notFound: boolean }
> {
return { notFound: true }
const props = await getValidatedPatternsTutorialViewProps(params.tutorialSlug)

// If the tutorial doesn't exist, hit the 404
Expand Down
7 changes: 4 additions & 3 deletions src/pages/validated-patterns/[collectionSlug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import validatedPatternsData from 'data/validated-patterns.json'

export async function getStaticProps({
params,
}: GetStaticPropsContext<{ collectionSlug: string }>): Promise<{
props: ValidatedPatternsCollectionViewProps
}> {
}: GetStaticPropsContext<{ collectionSlug: string }>): Promise<
{ props: ValidatedPatternsCollectionViewProps } | { notFound: boolean }
> {
return { notFound: true }
const allValidatedPatternsCollections = await getCollectionsBySection(
validatedPatternsData.slug
)
Expand Down
7 changes: 4 additions & 3 deletions src/pages/validated-patterns/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import getProcessedPageData from 'views/product-tutorials-view/helpers/page-data
import { TableOfContentsHeading } from 'components/table-of-contents'
import outlineItemsFromHeadings from 'components/outline-nav/utils/outline-items-from-headings'

export async function getStaticProps(): Promise<{
props: ValidatedPatternsLandingProps
}> {
export async function getStaticProps(): Promise<
{ props: ValidatedPatternsLandingProps } | { notFound: boolean }
> {
return { notFound: true }
const { pageData, headings: pageHeadings } = await getProcessedPageData(
validatedPatternsData.slug as PageSlugOption,
{ showOverviewHeading: false }
Expand Down

0 comments on commit a5425c2

Please sign in to comment.