Remove useless revalidate

This commit is contained in:
Defectink
2022-03-07 11:05:19 +08:00
parent b7037ba0f8
commit 36b7b35797
2 changed files with 2 additions and 3 deletions

View File

@ -8,7 +8,7 @@ export default async function handler(
req: NextApiRequest, req: NextApiRequest,
res: NextApiResponse res: NextApiResponse
) { ) {
const search = async () => { const getPosts = async () => {
const totalNum = await prisma.posts.count(); const totalNum = await prisma.posts.count();
const posts = await prisma.posts.findMany({ const posts = await prisma.posts.findMany({
orderBy: { orderBy: {
@ -46,7 +46,7 @@ export default async function handler(
switch (req.method) { switch (req.method) {
case 'GET': case 'GET':
return search(); return getPosts();
default: default:
return res.status(405).end(`Method ${req.method} Not Allowed`); return res.status(405).end(`Method ${req.method} Not Allowed`);
} }

View File

@ -89,7 +89,6 @@ export const getStaticProps: GetStaticProps<{
allPages, allPages,
posts: JSON.parse(JSON.stringify(posts)) as Post[], posts: JSON.parse(JSON.stringify(posts)) as Post[],
}, },
revalidate: 10,
}; };
}; };