From 838b0fd9a809e8da71719fb083993e29def4fca2 Mon Sep 17 00:00:00 2001 From: Andreas Petersen Date: Fri, 20 Oct 2023 15:40:04 +0200 Subject: [PATCH] Remove meta data from recipe edit page --- .../dashboard/recipe/[recipeId]/edit/page.tsx | 22 +------------------ .../dashboard/recipe/[recipeId]/page.tsx | 2 +- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/app/(dashboard)/dashboard/recipe/[recipeId]/edit/page.tsx b/src/app/(dashboard)/dashboard/recipe/[recipeId]/edit/page.tsx index 517afe36..f02bab7c 100644 --- a/src/app/(dashboard)/dashboard/recipe/[recipeId]/edit/page.tsx +++ b/src/app/(dashboard)/dashboard/recipe/[recipeId]/edit/page.tsx @@ -2,7 +2,6 @@ import { serverClient } from '@/app/_trpc/serverClient'; import { EditRecipeForm } from '@/components/forms/recipe/UpdateRecipeForm'; import { Breadcrumbs } from '@/components/pagers/breadcrumbs'; import { Shell } from '@/components/shells/shell'; -import { toTitleCase } from '@/lib/utils'; import { currentUser } from '@clerk/nextjs/server'; import { notFound } from 'next/navigation'; @@ -12,26 +11,7 @@ interface ProductPageProps { }; } -export async function generateMetadata({ params }: ProductPageProps) { - if (!params.recipeId) { - return {}; - } - - const recipe = await serverClient.recipe - .getRecipe({ id: params.recipeId }) - .catch(() => null); - - if (!recipe) { - return {}; - } - - return { - title: toTitleCase(recipe.title), - description: recipe.description ?? undefined, - }; -} - -export default async function ProductPage({ +export default async function RecipeEditPage({ params, }: Readonly) { if (!params.recipeId) { diff --git a/src/app/(dashboard)/dashboard/recipe/[recipeId]/page.tsx b/src/app/(dashboard)/dashboard/recipe/[recipeId]/page.tsx index 5be336d7..8ebff56c 100644 --- a/src/app/(dashboard)/dashboard/recipe/[recipeId]/page.tsx +++ b/src/app/(dashboard)/dashboard/recipe/[recipeId]/page.tsx @@ -31,7 +31,7 @@ export async function generateMetadata({ params }: ProductPageProps) { }; } -export default async function ProductPage({ +export default async function RecipeViewPage({ params, }: Readonly) { if (!params.recipeId) {