fixed build performance issues; optimized queries
This commit is contained in:
@@ -10,8 +10,8 @@ import { Button } from "@/components/ui/button";
|
||||
import Link from "next/link";
|
||||
|
||||
export default async function Home() {
|
||||
const categories = await api.category.getAll({ limit: 6 });
|
||||
const articles = await api.article.getAll({ limit: 6 });
|
||||
const categories = await api.category.getMany({ limit: 6 });
|
||||
const articles = await api.article.getMany({ limit: 6 });
|
||||
return (
|
||||
<>
|
||||
<Alert>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import * as cheerio from "cheerio";
|
||||
import { NextApiRequest } from "next";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(req: NextApiRequest) {
|
||||
export async function GET(req: Request) {
|
||||
if (req.method !== "GET") {
|
||||
return NextResponse.json({ error: "Method not allowed" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user