Skip to content

Commit

Permalink
#161 data 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaeyeon1 committed Dec 14, 2023
1 parent 8ca0a0d commit 593c9d5
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions client/src/app/[blogName]/home/[categoryId]/[postId]/page.tsx
Original file line number Diff line number Diff line change
@@ -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<Metadata> => {
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<Metadata> => {
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<Metadata> => {
// 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 (
Expand Down

0 comments on commit 593c9d5

Please sign in to comment.