Skip to content

Commit

Permalink
Edit Symbol guard clause when no content
Browse files Browse the repository at this point in the history
  • Loading branch information
gmolki committed Apr 15, 2024
1 parent 242a92b commit ae2ca16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/edit-symbol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ builder.init(process.env.NEXT_PUBLIC_BUILDER_API_KEY!);
export const getStaticProps = async (context: { resolvedUrl: string }) => {
// Dynamically fetch latest content from Builder.io API
const content = await builder.get("symbol", { url: context.resolvedUrl });
console;

return { props: { content } };
};

// View full integration and docs: https://builder.io/c/docs/developers
export default function Page(props: { content: BuilderContent | undefined }) {
if (!props.content) return;

return <BuilderComponent content={props.content} model="symbol" />;
}

0 comments on commit ae2ca16

Please sign in to comment.