Argument is missing
When I try to create a repair it throws me this error
Error:
15 const componentsData = components.map((component) => ({
16 component_name: component,
17 }));
→ 18 return this.prisma.repairs.create({
data: {
state_id: 2,
created_by: 1,
technician_id: 2,
machine_id: undefined,
+ state: {
+ create: RepairStatesCreateWithoutRepairsInput | RepairStatesUncheckedCreateWithoutRepairsInput,
+ connectOrCreate: RepairStatesCreateOrConnectWithoutRepairsInput,
+ connect: RepairStatesWhereUniqueInput
+ }
}
})
Argument
}, }); Models model Repairs { id Int @id @default(autoincrement()) machine_id Int technician_id Int state_id Int created_by Int created_at DateTime @default(now()) state RepairStates @relation(fields: [state_id], references: [id]) machine Machines @relation(fields: [machine_id], references: [id]) createdBy Employees @relation("repairCreatedBy", fields: [created_by], references: [id]) technician Employees @relation("technician", fields: [technician_id], references: [id]) diagnose Diagnoses? repairObservation RepairObservations? delivery Deliveries? quote Quotes? inventory Inventory? admissionObservation AdmissionObservations? } model RepairStates { id Int @id @default(autoincrement()) state_name String repairs Repairs[] }
state
is missing.
Function:
return this.prisma.repairs.create({
data: {
state_id: 2,
created_by: repairData.created_by,
technician_id: repairData.technician_id,
machine_id: repairData.machine_id,
}, }); Models model Repairs { id Int @id @default(autoincrement()) machine_id Int technician_id Int state_id Int created_by Int created_at DateTime @default(now()) state RepairStates @relation(fields: [state_id], references: [id]) machine Machines @relation(fields: [machine_id], references: [id]) createdBy Employees @relation("repairCreatedBy", fields: [created_by], references: [id]) technician Employees @relation("technician", fields: [technician_id], references: [id]) diagnose Diagnoses? repairObservation RepairObservations? delivery Deliveries? quote Quotes? inventory Inventory? admissionObservation AdmissionObservations? } model RepairStates { id Int @id @default(autoincrement()) state_name String repairs Repairs[] }
0 Replies