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:
JavaScript
x
12
12
1
const { id, nm_acara, tugas, nm_petugas } = req.body;
2
3
const result = await prisma.dinas.create({
4
data: {
5
kd_dinas: `D-${id}`,
6
nm_acara,
7
tugas,
8
nm_petugas,
9
rundown: "/texts/" + req.file.filename,
10
},
11
});
12
Advertisement
Answer
Do you sure you sent the id property to the server? or was it just created by the ORM?