17 lines
428 B
TypeScript

import { NextResponse } from 'next/server'
export async function GET(request: Request) {
const { searchParams } = new URL(request.url)
const roofMaterial = searchParams.get('roof-material')
console.log('🚀 ~ GET ~ roof-material:', roofMaterial)
// @ts-ignore
const suitables = await prisma.MS_SUITABLE.findMany({
where: {
roof_material: roofMaterial,
},
})
return NextResponse.json(suitables)
}