Fix type errors

This commit is contained in:
Jack Mechem 2026-03-27 18:44:06 -07:00
parent d346ccf701
commit 98b1daa7d3
2 changed files with 11 additions and 12 deletions

View file

@ -2,21 +2,18 @@ import { NextRequest, NextResponse } from "next/server";
export async function GET(
req: NextRequest,
{ params }: { params: { service: string } },
{ params }: { params: Promise<{ service: string }> },
) {
const token = req.cookies.get("token")?.value;
if (!token) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
const res = await fetch(
`http://localhost:3001/services/${params.service}/logs`,
{
headers: {
Authorization: `Bearer ${token}`,
},
},
);
const { service } = await params;
const res = await fetch(`http://localhost:3001/services/${service}/logs`, {
headers: { Authorization: `Bearer ${token}` },
});
return NextResponse.json(await res.json(), { status: res.status });
}