Add initial Portal version
This commit is contained in:
12
src/app/api/packages/route.ts
Normal file
12
src/app/api/packages/route.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { PACKAGE_CATALOG } from "@/lib/packages";
|
||||
|
||||
export async function GET() {
|
||||
const session = await auth();
|
||||
if (!session?.user) {
|
||||
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
||||
}
|
||||
|
||||
return NextResponse.json(PACKAGE_CATALOG);
|
||||
}
|
||||
Reference in New Issue
Block a user