change the wrong file name

This commit is contained in:
Yifei Hu 2024-07-12 11:05:55 +08:00
parent deb82d38b8
commit e8e90d84cc

View file

@ -0,0 +1,12 @@
import { NextResponse } from "next/server";
import { fetchNewsData } from "../../../../lib/fetchNewsData";
export async function GET(request: Request, { params }: { params: { id: string } }) {
const newsData = await fetchNewsData(params.id);
if (!newsData) {
return NextResponse.json({ error: "News not found" }, { status: 404 });
}
return NextResponse.json(newsData);
}