Add extras and options CRUD, add sidebar, add kanban board, udpate packages

This commit is contained in:
2026-01-29 16:18:57 +01:00
parent f9c14ed9fb
commit 507e1b9ee4
28 changed files with 2455 additions and 42 deletions

View File

@ -0,0 +1,27 @@
"use server";
import { revalidatePath } from "next/cache";
import { z } from "zod";
import { COMMISSION_STATUSES } from "@/lib/commissions/kanban";
import { prisma } from "@/lib/prisma"; // adjust to your prisma import
// import { requireAdmin } from "@/lib/auth/requireAdmin"; // recommended if you have it
const schema = z.object({
id: z.string().min(1),
status: z.enum(COMMISSION_STATUSES),
});
export async function updateCommissionRequestStatus(input: z.infer<typeof schema>) {
// await requireAdmin(); // enforce auth/role check here
const { id, status } = schema.parse(input);
await prisma.commissionRequest.update({
where: { id },
data: { status },
});
// revalidate the board page so a refresh always reflects server truth
revalidatePath("/commissions/board");
}