I have a field with id value in it. It auto created while created a new data. Concatenated with string. I have doing a try, but it gets undefined value.
- code:
const { id, nm_acara, tugas, nm_petugas } = req.body;
const result = await prisma.dinas.create({
data: {
kd_dinas: `D-${id}`,
nm_acara,
tugas,
nm_petugas,
rundown: "/texts/" + req.file.filename,
},
});
Advertisement
Answer
Do you sure you sent the id property to the server? or was it just created by the ORM?
