mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-13 15:38:59 +00:00
better error handling and fix typo
This commit is contained in:
parent
1492a8af0d
commit
75df284967
2 changed files with 4 additions and 4 deletions
|
|
@ -25,7 +25,7 @@ api.iapAndroidVerify = {
|
|||
async handler (req, res) {
|
||||
let resObject = await iapAndroidVerify(res.locals.user, req.body);
|
||||
return res
|
||||
.status(resObject.ok ? 200 : 500)
|
||||
.status(resObject.ok === true ? 200 : 500)
|
||||
.json(resObject);
|
||||
},
|
||||
};
|
||||
|
|
@ -44,7 +44,7 @@ api.iapiOSVerify = {
|
|||
async handler (req, res) {
|
||||
let resObject = await iapIOSVerify(res.locals.user, req.body);
|
||||
return res
|
||||
.status(resObject.ok ? 200 : 500)
|
||||
.status(resObject.ok === true ? 200 : 500)
|
||||
.json(resObject);
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ async function iapAndroidVerify (user, iapBody) {
|
|||
await IapPurchaseReceipt.create({
|
||||
_id: token,
|
||||
consumed: true,
|
||||
userID: user._id,
|
||||
userId: user._id,
|
||||
});
|
||||
|
||||
await payments.buyGems({
|
||||
|
|
@ -98,7 +98,7 @@ async function iapIOSVerify (user, iapBody) {
|
|||
await IapPurchaseReceipt.create({
|
||||
_id: token,
|
||||
consumed: true,
|
||||
userID: user._id,
|
||||
userId: user._id,
|
||||
});
|
||||
} else {
|
||||
throw new Error('RECEIPT_ALREADY_USED');
|
||||
|
|
|
|||
Loading…
Reference in a new issue