Update application code and dependencies

This commit is contained in:
root
2026-05-06 17:22:50 +08:00
parent efc8f4bf78
commit a3ee04379d
60 changed files with 6793 additions and 860 deletions
+37
View File
@@ -0,0 +1,37 @@
import { prisma } from "@/app/lib/prisma"
import { NextResponse } from "next/server"
export async function GET(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
const { id } = await params
const conversation = await prisma.conversation.findUnique({
where: { id: parseInt(id) },
include: {
messages: {
orderBy: { timestamp: "asc" },
},
},
})
if (!conversation) {
return NextResponse.json({ error: "Conversation not found" }, { status: 404 })
}
return NextResponse.json(conversation)
}
export async function DELETE(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
const { id } = await params
await prisma.conversation.delete({
where: { id: parseInt(id) },
})
return NextResponse.json({ success: true })
}