Sebastian Gug
10/19/2022, 3:16 PMTakeo Kusama
10/19/2022, 3:37 PMawait this.client.$transaction(async (prisma) => {
const current = await prisma.user.findUnique({where: id})
await prisma.user.update({
where: { id },
data: { emailVerificationSendCount: current.mailVerificationSendCount + 1 },
});
})
But, this log count way has risk to lose data if you don’t handle errors to retry correctly. If you want accuracy, I recommend to create log records to another table for inserting logs when event to log happens and aggregates them.Sebastian Gug
10/19/2022, 3:52 PMTakeo Kusama
10/19/2022, 4:02 PMSebastian Gug
10/19/2022, 4:04 PMNurul
10/20/2022, 6:56 AMTakeo Kusama
10/20/2022, 11:15 AMNurul
10/21/2022, 4:01 PM