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,
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`);
}

View File

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