mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
Remove useless revalidate
This commit is contained in:
@ -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`);
|
||||
}
|
||||
|
@ -89,7 +89,6 @@ export const getStaticProps: GetStaticProps<{
|
||||
allPages,
|
||||
posts: JSON.parse(JSON.stringify(posts)) as Post[],
|
||||
},
|
||||
revalidate: 10,
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user