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,
|
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`);
|
||||||
}
|
}
|
||||||
|
@ -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,
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user