import { NextResponse } from 'next/server'
import { prisma } from '@/libs/prisma'

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)
}
