@@ -3,7 +3,7 @@ import 'dayjs/locale/ko';
33import dayjs from 'dayjs' ;
44import { getTranslations } from 'next-intl/server' ;
55
6- import { CouncilReport } from '@/apis/types /council' ;
6+ import { getCouncilReport } from '@/apis/v2 /council/report/[id] ' ;
77import PostFooter from '@/app/[locale]/community/components/PostFooter' ;
88import { StraightNode } from '@/components/common/Nodes' ;
99import HTMLViewer from '@/components/form/html/HTMLViewer' ;
@@ -12,27 +12,13 @@ import PageLayout from '@/components/layout/pageLayout/PageLayout';
1212import { councilReportList } from '@/constants/segmentNode' ;
1313import { getMetadata } from '@/utils/metadata' ;
1414
15- const council : CouncilReport = {
16- id : 2 ,
17- title : 'title' ,
18- description : 'description' ,
19- sequence : 1 ,
20- name : 'name' ,
21- createdAt : '2022-01-01T00:00:00.000Z' ,
22- prevId : 1 ,
23- prevTitle : 'prevTitle' ,
24- nextId : 3 ,
25- nextTitle : 'nextTitle' ,
26- } ;
27-
2815interface Props {
2916 params : Promise < { id : number ; locale : string } > ;
3017}
3118
3219export async function generateMetadata ( { params } : Props ) {
33- const { locale } = await params ;
34- // const { title } = await getCouncilReport(id);
35- const { title } = council ;
20+ const { locale, id } = await params ;
21+ const { title } = await getCouncilReport ( id ) ;
3622
3723 return await getMetadata ( {
3824 locale,
@@ -42,10 +28,9 @@ export async function generateMetadata({ params }: Props) {
4228}
4329
4430export default async function CouncilReportPage ( { params } : Props ) {
45- const { id, locale } = await params ;
46- const t = await getTranslations ( { locale } ) ;
47-
48- // const council = await getCouncilReport(id);
31+ const { id } = await params ;
32+ const t = await getTranslations ( 'Content' ) ;
33+ const council = await getCouncilReport ( id ) ;
4934
5035 const { title, description, sequence, name, createdAt } = council ;
5136 const author = `제${ sequence } 대 학생회 ${ name } ` ;
@@ -70,7 +55,13 @@ export default async function CouncilReportPage({ params }: Props) {
7055 >
7156 < HTMLViewer htmlContent = { description } wrapperClassName = "mb-10" />
7257 < StraightNode />
73- < PostFooter post = { council } postType = "council/report" id = { id . toString ( ) } margin = "mt-12" />
58+ < PostFooter
59+ post = { council }
60+ postType = "council/report"
61+ id = { id . toString ( ) }
62+ margin = "mt-12"
63+ role = { [ 'ROLE_COUNCIL' , 'ROLE_STAFF' ] }
64+ />
7465 </ div >
7566 </ PageLayout >
7667 ) ;
0 commit comments