hedera-web/js/hedera/basket-checker.js

25 lines
497 B
JavaScript
Raw Normal View History

2016-09-26 09:28:47 +00:00
2019-05-21 14:16:27 +00:00
module.exports = {
check: function(conn, callback) {
conn.execQuery('CALL myBasket_check',
this._onBasketCheck.bind(this, callback));
},
2016-09-26 09:28:47 +00:00
2019-05-21 14:16:27 +00:00
_onBasketCheck: function(callback, resultSet) {
var status = resultSet.fetchValue();
2016-09-26 09:28:47 +00:00
if (!status)
return;
var isOk = status == 'UPDATED' || status == 'OK';
if (status == 'UPDATED')
2019-05-21 14:16:27 +00:00
Htk.Toast.showWarning(_('Order items updated'));
2016-09-26 09:28:47 +00:00
if (callback)
2019-05-21 14:16:27 +00:00
callback(isOk);
2016-09-26 09:28:47 +00:00
if (!isOk)
2019-05-21 14:16:27 +00:00
Vn.Hash.set({form: 'ecomerce/checkout'});
2016-09-26 09:28:47 +00:00
}
};