-
I'm trying to use the import { auth } from "@/utils/auth";
export const GET = auth(
// next line: No overload matches this call
async (req: Request, { params }: { params: { id: string } }) => {
return Response.json({ params.id });
}
) as any; it seems the |
Beta Was this translation helpful? Give feedback.
Answered by
hexcowboy
Dec 20, 2023
Replies: 2 comments 1 reply
-
i'm assuming this would probably work import { NextRequest } from "next/server";
export async function GET(
request: NextRequest,
context: { params: { id: string } }
) {
return auth(async () => {
// ... you can use `context.params.id` here
})(request, context) as any;
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hexcowboy
-
For my folder structure, I have 'api -> folder -> [id] -> route.ts', I was using:
...but also, you could extract it from the URL like @hexcowboy stated:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i'm assuming this would probably work