Fix the claim logic removing a user's currency before it checks if the card is actually claimable
All checks were successful
Test / build (push) Successful in 7s
All checks were successful
Test / build (push) Successful in 7s
This commit is contained in:
parent
976445fa0d
commit
e584c1291b
3 changed files with 20 additions and 2 deletions
|
@ -31,8 +31,6 @@ export default class Claim extends ButtonEvent {
|
|||
return;
|
||||
}
|
||||
|
||||
await user.Save(User, user);
|
||||
|
||||
const claimed = await eClaim.FetchOneByClaimId(claimId);
|
||||
|
||||
if (claimed) {
|
||||
|
@ -45,6 +43,8 @@ export default class Claim extends ButtonEvent {
|
|||
return;
|
||||
}
|
||||
|
||||
await user.Save(User, user);
|
||||
|
||||
let inventory = await Inventory.FetchOneByCardNumberAndUserId(userId, cardNumber);
|
||||
|
||||
if (!inventory) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue