founders card
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { getSessionAccount } from "@/lib/auth/require-session";
|
||||
import { canReadPage } from "@/lib/auth/permissions";
|
||||
import { listEarlyPlayerEmails } from "@/lib/card-gen/early-player-emails";
|
||||
|
||||
export const runtime = "nodejs";
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export async function GET() {
|
||||
const account = await getSessionAccount();
|
||||
if (!account || !canReadPage(account, "founders-card")) {
|
||||
return Response.json({ error: "Unauthorized" }, { status: 401 });
|
||||
}
|
||||
|
||||
const result = await listEarlyPlayerEmails();
|
||||
if ("error" in result) {
|
||||
return Response.json({ error: result.error }, { status: 500 });
|
||||
}
|
||||
|
||||
return Response.json({ emails: result.rows });
|
||||
}
|
||||
Reference in New Issue
Block a user