feat: Implement delete confirmation modal and restrict delete access to team leads
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user