feat: Implement delete confirmation modal and restrict delete access to team leads

This commit is contained in:
2026-01-22 21:51:37 +01:00
parent 84f63c37ce
commit b358f5d7b7
2 changed files with 247 additions and 50 deletions

View File

@@ -1,6 +1,6 @@
import db from "@/lib/db";
import { NextResponse } from "next/server";
import { withReadAuth, withUserAuth } from "@/lib/middleware/auth";
import { withReadAuth, withTeamLeadAuth } from "@/lib/middleware/auth";
async function getContractHandler(req, { params }) {
const { id } = await params;
@@ -61,4 +61,4 @@ async function deleteContractHandler(req, { params }) {
// Protected routes - require authentication
export const GET = withReadAuth(getContractHandler);
export const DELETE = withUserAuth(deleteContractHandler);
export const DELETE = withTeamLeadAuth(deleteContractHandler);