0
1
Fork 0
hedera-web-mindshore/js/hedera/basket-checker.js

22 lines
419 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
2019-05-21 14:16:27 +00:00
module.exports = {
2022-11-28 08:51:31 +00:00
async check(conn, hash) {
2022-05-30 01:30:33 +00:00
this.hash = hash;
2022-11-28 08:51:31 +00:00
const resultSet = await conn.execQuery('CALL myBasket_check');
2016-09-26 09:28:47 +00:00
2022-11-28 08:51:31 +00:00
const status = resultSet.fetchValue();
if (!status) return;
const isOk = status == 'UPDATED' || status == 'OK';
2016-09-26 09:28:47 +00:00
if (status == 'UPDATED')
2019-05-21 14:16:27 +00:00
Htk.Toast.showWarning(_('Order items updated'));
2022-11-28 08:51:31 +00:00
2016-09-26 09:28:47 +00:00
if (!isOk)
2022-05-30 01:30:33 +00:00
this.hash.setAll({form: 'ecomerce/checkout'});
2022-11-28 08:51:31 +00:00
return isOk;
2016-09-26 09:28:47 +00:00
}
};