diff --git a/pages/api/posts.ts b/pages/api/posts.ts index 80af0b2..7104523 100644 --- a/pages/api/posts.ts +++ b/pages/api/posts.ts @@ -8,7 +8,7 @@ export default async function handler( req: NextApiRequest, res: NextApiResponse ) { - const search = async () => { + const getPosts = async () => { const totalNum = await prisma.posts.count(); const posts = await prisma.posts.findMany({ orderBy: { @@ -46,7 +46,7 @@ export default async function handler( switch (req.method) { case 'GET': - return search(); + return getPosts(); default: return res.status(405).end(`Method ${req.method} Not Allowed`); } diff --git a/pages/page/[num].tsx b/pages/page/[num].tsx index 84605f0..5083f11 100644 --- a/pages/page/[num].tsx +++ b/pages/page/[num].tsx @@ -89,7 +89,6 @@ export const getStaticProps: GetStaticProps<{ allPages, posts: JSON.parse(JSON.stringify(posts)) as Post[], }, - revalidate: 10, }; };