100xdevs-cohort-2 / week-18-2-ci-cd

8 stars 480 forks source link

bank-webhook , updating balance issue for new user having zero balance #60

Open Akshat-Kumar-work opened 6 months ago

Akshat-Kumar-work commented 6 months ago

When the new user having zero balance tried to add balance, after the on-ramp-transaction success, the balance will not addedd to the user balance table, because we are only updating the balance , it will provide no record found error, hence we have to check if the balance array length is zero then we dont want to update the balance we want to create the balance record.

bug
amarnath666 commented 5 months ago

When creating new user in authOptions by prisma.user.create we can also add Balance : {create: { amount: 0, locked: 0 } }this also will work.