feat: implement comprehensive CMS dashboard for managing news, events, interviews, and one-shot pricing plans
This commit is contained in:
14
app/api/one-shot-plans/route.ts
Normal file
14
app/api/one-shot-plans/route.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const plans = await prisma.oneShotPlan.findMany({
|
||||
orderBy: { type: 'asc' }
|
||||
});
|
||||
return NextResponse.json(plans);
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch one-shot plans:", error);
|
||||
return NextResponse.json({ error: "Failed to fetch plans" }, { status: 500 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user