Files
pieced-portal/src/app/api/tenants/route.ts
admin 22fd5fb2cc
All checks were successful
Build and Push / build (push) Successful in 1m23s
TenantAssignment and readside filtering
2026-04-26 22:58:30 +02:00

15 lines
475 B
TypeScript

import { NextResponse } from "next/server";
import { getSessionUser } from "@/lib/session";
import { listTenants } from "@/lib/k8s";
import { listVisibleTenants } from "@/lib/visibility";
export async function GET() {
const user = await getSessionUser();
if (!user)
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
const all = await listTenants();
const visible = await listVisibleTenants(user, all);
return NextResponse.json(visible);
}