Skip to content

Commit

Permalink
fix(board/id) : page params 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
kxmmxnzx committed Oct 31, 2024
1 parent f1a6806 commit f718072
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/app/[country]/board/[Id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@ import AttributeBox from '@/components/country/board/id/AttributeBox';
import { BoardDetailType } from '@/types/country/board';
import { headers } from 'next/headers';

const Page = async ({ params }: { params: { id: string } }) => {
const Page = async ({
params,
}: {
params: { country: string; id: string };
}) => {
console.log(params);
const headersList = headers();
const host = headersList.get('host');
const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';

const response = await fetch(
const boardData = await fetch(
`${protocol}://${host}/api/board?boardId=${params.id}`,
);

console.log(`${protocol}://${host}/api/board?boardId=${params.id}`);
const boardData = await response.json();
).then((res) => res.json());

const boardDetail: BoardDetailType = boardData.data;

Expand Down

0 comments on commit f718072

Please sign in to comment.