docker fixes
This commit is contained in:
@@ -7,8 +7,9 @@ import { getToken } from "next-auth/jwt";
|
||||
|
||||
export async function POST(
|
||||
req: Request,
|
||||
{ params }: { params: { id: string } }
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
const { id } = await params;
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
// We need the raw access token from JWT for Google API
|
||||
@@ -19,7 +20,7 @@ export async function POST(
|
||||
}
|
||||
|
||||
const report = await prisma.report.findUnique({
|
||||
where: { id: params.id, userId: session.user.id },
|
||||
where: { id, userId: session.user.id },
|
||||
include: { tasks: true, user: true },
|
||||
});
|
||||
|
||||
@@ -45,7 +46,7 @@ export async function POST(
|
||||
|
||||
// Update report status to SUBMITTED
|
||||
await prisma.report.update({
|
||||
where: { id: params.id },
|
||||
where: { id },
|
||||
data: { status: 'SUBMITTED' }
|
||||
});
|
||||
|
||||
|
||||
@@ -6,8 +6,9 @@ import { prisma } from "@/lib/prisma";
|
||||
// PATCH /api/reports/[id] - Update report status or manager
|
||||
export async function PATCH(
|
||||
req: Request,
|
||||
{ params }: { params: { id: string } }
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
const { id } = await params;
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
if (!session) {
|
||||
@@ -17,7 +18,7 @@ export async function PATCH(
|
||||
const { status, managerName } = await req.json();
|
||||
|
||||
const report = await prisma.report.update({
|
||||
where: { id: params.id, userId: session.user.id },
|
||||
where: { id, userId: session.user.id },
|
||||
data: { status, managerName },
|
||||
});
|
||||
|
||||
@@ -27,8 +28,9 @@ export async function PATCH(
|
||||
// GET /api/reports/[id] - Fetch a specific report
|
||||
export async function GET(
|
||||
req: Request,
|
||||
{ params }: { params: { id: string } }
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
const { id } = await params;
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
if (!session) {
|
||||
@@ -36,7 +38,7 @@ export async function GET(
|
||||
}
|
||||
|
||||
const report = await prisma.report.findUnique({
|
||||
where: { id: params.id },
|
||||
where: { id },
|
||||
include: { tasks: true },
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user