实现了AI助手
This commit is contained in:
@@ -1,19 +1,14 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
import { ComponentService } from '@/lib/services/component-service'
|
||||
|
||||
export async function GET(
|
||||
request: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string }> }
|
||||
) {
|
||||
try {
|
||||
) { try {
|
||||
const { id } = await params
|
||||
|
||||
const component = await prisma.component.findUnique({
|
||||
where: { id: id },
|
||||
include: {
|
||||
componentType: true
|
||||
}
|
||||
})
|
||||
const component = await ComponentService.getComponentById(id)
|
||||
|
||||
if (!component) {
|
||||
return NextResponse.json(
|
||||
|
||||
Reference in New Issue
Block a user