Type '{ connectOrCreate: { where: { state_name: string; }; create: { state_name: string; }; }; }' is
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 @unique
repairs Repairs[]
}
return this.prisma.machines.create({
data: {
...machineData,
repairs: {
create: {
state: {
connectOrCreate: {
where: { state_name: 'EN_DIAGNOSTICO' },
create: { state_name: 'EN_DIAGNOSTICO' },
},
},
technician_id: repair.technician_id,
created_by: repair.created_by,
admissionObservation: {
create: {
...admission_observations,
components: {
createMany: { data: componentsData },
},
},
},
},
},
},
});
Type '{ connectOrCreate: { where: { state_name: string; }; create: { state_name: string; }; }; }' is not assignable to type 'never'.ts(2322)
(property) state: {
connectOrCreate: {
where: {
state_name: string;
};
create: {
state_name: string;
};
};
}
0 Replies