This commit is contained in:
Benjamin Toby
2024-10-01 16:17:51 +01:00
parent a6a3b8056d
commit a3732103bf
3 changed files with 69 additions and 62 deletions
+17 -13
View File
@@ -56,20 +56,24 @@ export default async function BlogIndex({
}: {
params: any;
}) {
//* Data fetching
const post = await getPost({ single: single });
try {
//* Data fetching
const post = await getPost({ single: single });
if (!post) {
if (!post) {
return redirect("/blog");
}
//* Main Function Return
/////////////////////////////////////////////
return (
<React.Fragment>
<Main post={post} />
</React.Fragment>
);
/** ********************************************** */
} catch (error) {
return redirect("/blog");
}
//* Main Function Return
/////////////////////////////////////////////
return (
<React.Fragment>
<Main post={post} />
</React.Fragment>
);
/** ********************************************** */
}