All the initial admin requests approval flow
This commit is contained in:
1 parent
94bfd25553
commit
9a96d74f5c
7 files changed
+604
-88
No files matched your search
@@ -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 }
|
||||
|
||||
Reference in new issue
Block a user