From 593c9d5750ec9278d71db700b806e33f343bbbe0 Mon Sep 17 00:00:00 2001 From: Chaeyeon1 <66813821+Chaeyeon1@users.noreply.github.com> Date: Thu, 14 Dec 2023 18:28:52 +0900 Subject: [PATCH] =?UTF-8?q?#161=20data=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/[categoryId]/[postId]/page.tsx | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/client/src/app/[blogName]/home/[categoryId]/[postId]/page.tsx b/client/src/app/[blogName]/home/[categoryId]/[postId]/page.tsx index de8d3fa..723e4a9 100644 --- a/client/src/app/[blogName]/home/[categoryId]/[postId]/page.tsx +++ b/client/src/app/[blogName]/home/[categoryId]/[postId]/page.tsx @@ -1,29 +1,39 @@ import PostData from '@/components/Post/PostData'; -import { SERVER_URL } from '@/constant/common'; +// import { SERVER_URL } from '@/constant/common'; import { Metadata } from 'next'; import React from 'react'; -const getData = async (id: number) => { - const res = await fetch(`${SERVER_URL}/post?postId=${id}`); - return res.json(); -}; - -export const generateMetadata = async ({ - params, -}: { - params: { id: string }; -}): Promise => { - const data = await getData(Number(params.id)); +// const getData = async (id: number) => { +// const res = await fetch(`${SERVER_URL}/post?postId=${id}`); +// return res.json(); +// }; +export const generateMetadata = async (): Promise => { return { - title: data.title, - description: data.content, + title: '타이틀입니다.', + description: 'ㅁㄴㅇㄹ', openGraph: { - title: data.title, - description: data.content, + title: 'openGraph 타이틀이빈다.', + description: 'ㅁㄴㅇㄹ', }, }; }; +// export const generateMetadata = async ({ +// params, +// }: { +// params: { id: string }; +// }): Promise => { +// const data = await getData(Number(params.id)); + +// return { +// title: '타이틀입니다.', +// description: 'ㅁㄴㅇㄹ', +// openGraph: { +// title: 'openGraph 타이틀이빈다.', +// description: 'ㅁㄴㅇㄹ', +// }, +// }; +// }; function page({ params }: { params: { blogName: string; categoryId: string; postId: string } }) { return (