Yaakov
05/04/2022, 8:39 PMstring into rust type `String``
at Object.transaction (/usr/src/app/node_modules/@prisma/client/runtime/index.js:41312:64)
at async Proxy._transactionWithCallback (/usr/src/app/node_modules/@prisma/client/runtime/index.js:46414:21)
model Person {
id Int @id @default(autoincrement())
name String
}
<http://router.post|router.post>('/person', (req, res, next) => {
prisma.$transaction(async (prisma) => {
const person = await prisma.person.create({
data: {
name: 'A new role',
},
});
// Do something else
return person;
}).then(person => res.status(201).json(person))
.catch(next);
});Nurul
05/05/2022, 12:38 PMYaakov
05/05/2022, 1:37 PM