mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-31 01:25:26 +08:00
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
17 lines
507 B
TypeScript
17 lines
507 B
TypeScript
import { type NextRequest } from 'next/server'
|
|
import { NextResponse } from 'next/server'
|
|
import { client, getInfo } from '@/app/api/utils/common'
|
|
|
|
export async function POST(request: NextRequest, { params }: {
|
|
params: Promise<{ messageId: string }>
|
|
}) {
|
|
const body = await request.json()
|
|
const {
|
|
rating,
|
|
} = body
|
|
const { messageId } = await params
|
|
const { user } = getInfo(request)
|
|
const { data } = await client.messageFeedback(messageId, rating, user)
|
|
return NextResponse.json(data)
|
|
}
|