All the initial admin requests approval flow

This commit is contained in:
2026-04-11 11:54:21 +02:00
parent 94bfd25553
commit 9a96d74f5c
7 changed files with 604 additions and 88 deletions

View File

@@ -6,6 +6,7 @@ import { createTenant } from "@/lib/k8s";
/**
* POST /api/admin/requests/[id]/approve
* Approve a tenant request: create the PiecedTenant CR and update status.
* Also supports re-approving a previously rejected request.
*/
export async function POST(
request: Request,
@@ -29,7 +30,7 @@ export async function POST(
);
}
if (tenantRequest.status !== "pending") {
if (tenantRequest.status !== "pending" && tenantRequest.status !== "rejected") {
return NextResponse.json(
{ error: `Request is already ${tenantRequest.status}` },
{ status: 400 }