Skip to content

Commit

Permalink
Merge pull request #1157 from prezly/feature/dev-12308-no-content-sho…
Browse files Browse the repository at this point in the history
…ws-a-welcome-message-should-it-show-something

[DEV-12308] Feature - Show a 404 page if category is empty
  • Loading branch information
kudlajz authored Jun 5, 2024
2 parents 5f30476 + daeaf96 commit 85aa5d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/[localeCode]/category/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface Props {

async function resolve({ localeCode, slug }: Props['params']) {
const translatedCategory = await app().translatedCategory(localeCode, slug);
if (!translatedCategory) notFound();
if (!translatedCategory || translatedCategory.public_stories_number === 0) notFound();

const category = await app().category(translatedCategory.id);
if (!category) notFound();
Expand Down

0 comments on commit 85aa5d5

Please sign in to comment.