Skip to content

Commit

Permalink
chore: error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dennyscode committed Feb 12, 2025
1 parent 788631a commit 8746beb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/app/[lng]/onboard/abstract/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { Metadata } from 'next';
import { notFound } from 'next/navigation';
import type { PropsWithChildren } from 'react';
import { getPartnerThemes } from 'src/app/lib/getPartnerThemes';
import { Layout } from 'src/Layout';

export const metadata: Metadata = {
Expand All @@ -9,5 +11,14 @@ export const metadata: Metadata = {
};

export default async function InfosLayout({ children }: PropsWithChildren) {
const partnerThemes = await getPartnerThemes();

const partnerThemesData = partnerThemes.data?.find(
(d) => d.attributes?.uid === 'abstract',
);

if (!partnerThemesData) {
return notFound();
}
return <Layout>{children}</Layout>;
}

0 comments on commit 8746beb

Please sign in to comment.