refactor: Rename Suitable model to MS_SUITABLE and update related API endpoints
This commit is contained in:
parent
0a1d34b6db
commit
0cdc3984b8
@ -19,7 +19,7 @@ model User {
|
||||
updated_at DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Suitable {
|
||||
model MS_SUITABLE {
|
||||
id Int @id @default(autoincrement())
|
||||
product_name String
|
||||
manufacturer String?
|
||||
@ -56,3 +56,11 @@ model Suitable {
|
||||
created_at DateTime @default(now())
|
||||
updated_at DateTime @updatedAt
|
||||
}
|
||||
|
||||
model SD_SERVEY_SALES {
|
||||
id Int @id @default(autoincrement())
|
||||
title String @db.VarChar(200)
|
||||
content String?
|
||||
created_at DateTime @default(now())
|
||||
updated_at DateTime @updatedAt
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ export async function GET(request: Request) {
|
||||
console.log('🚀 ~ GET ~ roof-material:', roofMaterial)
|
||||
|
||||
// @ts-ignore
|
||||
const suitables = await prisma.suitable.findMany({
|
||||
const suitables = await prisma.MS_SUITABLE.findMany({
|
||||
where: {
|
||||
roof_material: roofMaterial,
|
||||
},
|
||||
|
||||
@ -3,6 +3,6 @@ import { prisma } from '@/libs/prisma'
|
||||
|
||||
export async function GET() {
|
||||
// @ts-ignore
|
||||
const suitables = await prisma.suitable.findMany()
|
||||
const suitables = await prisma.MS_SUITABLE.findMany()
|
||||
return NextResponse.json(suitables)
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import { prisma } from '@/libs/prisma'
|
||||
export async function POST(request: Request) {
|
||||
const body = await request.json()
|
||||
// @ts-ignore
|
||||
const suitables = await prisma.suitable.createMany({
|
||||
const suitables = await prisma.MS_SUITABLE.createMany({
|
||||
data: body,
|
||||
})
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import Suitable from '@/components/Suitable'
|
||||
// import SuitableCreateBtn from '@/components/SuitableCreateBtn'
|
||||
import SuitableCreateBtn from '@/components/SuitableCreateBtn'
|
||||
import SuitableSearch from '@/components/SuitableSearch'
|
||||
|
||||
export default function suitablePage() {
|
||||
@ -8,7 +8,7 @@ export default function suitablePage() {
|
||||
<SuitableSearch />
|
||||
<Suitable />
|
||||
{/* 최초 한번 밀어넣음 */}
|
||||
{/* <SuitableCreateBtn /> */}
|
||||
<SuitableCreateBtn />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user