fix: await params in dynamic route for Next.js 15 compatibility

This commit is contained in:
lyzno1
2025-09-11 12:39:35 +08:00
parent 532aba026a
commit 0cb8fdcf15

View File

@ -3,14 +3,14 @@ import { NextResponse } from 'next/server'
import { client, getInfo } from '@/app/api/utils/common' import { client, getInfo } from '@/app/api/utils/common'
export async function POST(request: NextRequest, { params }: { export async function POST(request: NextRequest, { params }: {
params: { conversationId: string } params: Promise<{ conversationId: string }>
}) { }) {
const body = await request.json() const body = await request.json()
const { const {
auto_generate, auto_generate,
name, name,
} = body } = body
const { conversationId } = params const { conversationId } = await params
const { user } = getInfo(request) const { user } = getInfo(request)
// auto generate name // auto generate name