Skip to content

Commit

Permalink
removed NotFound()
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbermanssw committed Jan 20, 2025
1 parent e0d47dc commit d3d4e8f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/blog/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,9 @@ export default async function BlogPage({
const vars = { relativePath: `${slug}.mdx` };
try {
const res = await client.queries.getExpandedPostDocument(vars);

if (!res?.data?.post) {
console.warn(`Post not found for slug: ${slug}`);
return notFound();
}

return <BlogPageClient {...res} />;
} catch (error) {
console.error(`Error fetching post for slug: ${slug}`, error);
return notFound();
}
}
}

0 comments on commit d3d4e8f

Please sign in to comment.