Skip to content

Commit

Permalink
feat: Update PageProps to handle slug as a Promise and refactor conte…
Browse files Browse the repository at this point in the history
…nt retrieval
  • Loading branch information
ultron01 committed Dec 29, 2024
1 parent e3ba7de commit a69afd9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/projekty/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ async function getPostData(slug: string) {

export interface PageProps {
params: {
slug: string;
slug: string | Promise<string>;
};
}

export default async function Page({ params }: PageProps) {
const content = await getPostData(params.slug);
const slug = await params.slug; // Vyřeší případný Promise
const content = await getPostData(slug);

if (content == null) {
return notFound();
Expand Down

0 comments on commit a69afd9

Please sign in to comment.