This commit is contained in:
@@ -7,6 +7,11 @@ function requireRole(role: string) {
|
||||
return ["ADMIN", "PRODUCER", "SUPERVISOR"].includes(role);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function bigIntSafe(obj: any): any {
|
||||
return JSON.parse(JSON.stringify(obj, (_, v) => (typeof v === "bigint" ? Number(v) : v)));
|
||||
}
|
||||
|
||||
// GET /api/shoot-log/takes/[takeId]/attachments
|
||||
export async function GET(
|
||||
_req: NextRequest,
|
||||
@@ -24,7 +29,7 @@ export async function GET(
|
||||
include: { uploadedBy: { select: { id: true, name: true } } },
|
||||
});
|
||||
|
||||
return NextResponse.json({ attachments });
|
||||
return NextResponse.json(bigIntSafe({ attachments }));
|
||||
}
|
||||
|
||||
// POST /api/shoot-log/takes/[takeId]/attachments
|
||||
@@ -65,5 +70,5 @@ export async function POST(
|
||||
},
|
||||
});
|
||||
|
||||
return NextResponse.json({ attachment }, { status: 201 });
|
||||
return NextResponse.json(bigIntSafe({ attachment }), { status: 201 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user