mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-08 17:32:27 +08:00
✨Error: Route "/api/messages/[messageId]/feedbacks" used params.messageId. params should be awaited before using its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
at POST (app/api/messages/[messageId]/feedbacks/route.ts:12:11)
10 | rating,
11 | } = body
> 12 | const { messageId } = params
| ^
13 | const { user } = getInfo(request)
14 | const { data } = await client.messageFeedback(messageId, rating, user)
15 | return NextResponse.json(data)
POST /api/messages/36fd2d18-909b-4bb9-b46d-6e7f72a705e4/feedbacks 200 in 557ms
This commit is contained in:
@ -3,13 +3,13 @@ import { NextResponse } from 'next/server'
|
||||
import { client, getInfo } from '@/app/api/utils/common'
|
||||
|
||||
export async function POST(request: NextRequest, { params }: {
|
||||
params: { messageId: string }
|
||||
params: Promise<{ messageId: string }>
|
||||
}) {
|
||||
const body = await request.json()
|
||||
const {
|
||||
rating,
|
||||
} = body
|
||||
const { messageId } = params
|
||||
const { messageId } = await params
|
||||
const { user } = getInfo(request)
|
||||
const { data } = await client.messageFeedback(messageId, rating, user)
|
||||
return NextResponse.json(data)
|
||||
|
||||
Reference in New Issue
Block a user