Shahid Mawji
05/13/2022, 7:21 PMimport { prisma } from "../prisma";
await prisma.$transaction(async (prisma) => {
const booking = await prisma.bookingGroup.create(..)
EmailService.sendEmail(booking) //If this function also has a prisma call, the transaction fails
});
I'm unsure if theres a best practice we should be following here (we're looking to keep our code concise but this seems to be a limitation of abstracting out logic if it involves the database)