1 const t = await sequelizeConfig.transaction({
2 autocommit: false
3 })
4
5 const userDeatils = await User.create({
6 firstName: 'Abraham',
7 lastName: 'Lincoln'
8 }, {transaction: t})
9
10 await t.commit()
11 return t
12
13 This return transaction(t) on success returns finished property which is 'commit' on success
14
15 So here in response we can check response.finised == 'commit
16
17 finished =='commit'
18
19 if(response.finised == 'commit){
20
21 return res.json({
22
23 code:'',
24 ................
25 })
26
27