peppa/apps/web/app/api/palette/route.ts
2026-11-14 06:29:00 +05:00

13 lines
537 B
TypeScript

import { paletteItems } from "@peppa/core";
import { currentUser } from "@/lib/auth";
import { db } from "@/lib/db";
export const dynamic = "force-dynamic";
/** Command palette data (PEP-52): projects, stories, runners and open questions of the user's projects. */
export async function GET() {
const user = await currentUser();
if (!user) return Response.json({ error: "unauthorized" }, { status: 401 });
return Response.json({ items: await paletteItems(db, user.id) }, { headers: { "Cache-Control": "private, no-store" } });
}