Merge pull request 'chore: remove unused API routes and components for survey sales and suitable details' (#8) from feature/ready-for-work into dev
Reviewed-on: #8
This commit is contained in:
commit
b9cc66090e
@ -1,16 +0,0 @@
|
||||
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)
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { prisma } from '@/libs/prisma'
|
||||
|
||||
export async function GET() {
|
||||
// @ts-ignore
|
||||
const suitables = await prisma.MS_SUITABLE.findMany()
|
||||
return NextResponse.json(suitables)
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { prisma } from '@/libs/prisma'
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const body = await request.json()
|
||||
|
||||
// @ts-ignore
|
||||
const res = await prisma.SD_SERVEY_SALES_BASIC_INFO.create({
|
||||
data: body,
|
||||
})
|
||||
|
||||
return NextResponse.json({ message: 'Survey sales created successfully' })
|
||||
}
|
||||
|
||||
export async function GET(request: Request) {
|
||||
// @ts-ignore
|
||||
const res = await prisma.SD_SERVEY_SALES_BASIC_INFO.findMany({
|
||||
include: {
|
||||
detail_info: true,
|
||||
},
|
||||
})
|
||||
return NextResponse.json(res)
|
||||
}
|
||||
|
||||
export async function PUT(request: Request) {
|
||||
const body = await request.json()
|
||||
console.log('🚀 ~ PUT ~ body:', body)
|
||||
const detailInfo = { ...body.detail_info, basic_info_id: body.id }
|
||||
console.log('🚀 ~ PUT ~ detailInfo:', detailInfo)
|
||||
// @ts-ignore
|
||||
const res = await prisma.SD_SERVEY_SALES_DETAIL_INFO.create({
|
||||
data: detailInfo,
|
||||
})
|
||||
return NextResponse.json({ message: 'Survey sales updated successfully' })
|
||||
}
|
||||
@ -1,10 +0,0 @@
|
||||
import SurveySales from '@/components/SurveySales'
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<>
|
||||
<h1 className="text-2xl font-bold my-4 flex justify-center">조사 매물 정보</h1>
|
||||
<SurveySales />
|
||||
</>
|
||||
)
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user