diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 2c33b9b..fbf8986 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -3,20 +3,12 @@ import useSWR from 'swr'; import Layout from '../shared/component/layout'; import { + type PostMeta, PostService, } from '../shared/service/post.service'; const KEY_POST = '/api/posts'; -interface Posts { - title: string; - date: string; - description: string; - thumbnail: string; - slug: string; - keyword: string; -} - export const getStaticProps = async () => { const postMetaList = await PostService.getMetaList(); @@ -30,7 +22,7 @@ export const getStaticProps = async () => { }; function PostNames() { - const { data: postMetaList } = useSWR(KEY_POST); + const { data: postMetaList } = useSWR>(KEY_POST); return (