feat: Add team lead authorization for project deletion and implement delete confirmation modal in edit project page
This commit is contained in:
@@ -11,7 +11,7 @@ import { logFieldChange } from "@/lib/queries/fieldHistory";
|
||||
import { addNoteToProject } from "@/lib/queries/notes";
|
||||
import initializeDatabase from "@/lib/init-db";
|
||||
import { NextResponse } from "next/server";
|
||||
import { withReadAuth, withUserAuth } from "@/lib/middleware/auth";
|
||||
import { withReadAuth, withUserAuth, withTeamLeadAuth } from "@/lib/middleware/auth";
|
||||
import {
|
||||
logApiActionSafe,
|
||||
AUDIT_ACTIONS,
|
||||
@@ -155,4 +155,4 @@ async function deleteProjectHandler(req, { params }) {
|
||||
// Protected routes - require authentication
|
||||
export const GET = withReadAuth(getProjectHandler);
|
||||
export const PUT = withUserAuth(updateProjectHandler);
|
||||
export const DELETE = withUserAuth(deleteProjectHandler);
|
||||
export const DELETE = withTeamLeadAuth(deleteProjectHandler);
|
||||
|
||||
Reference in New Issue
Block a user