forked from verdnatura/hedera-web
26 lines
508 B
JavaScript
26 lines
508 B
JavaScript
|
|
module.exports = {
|
|
check(conn, hash, callback) {
|
|
this.hash = hash;
|
|
conn.execQuery('CALL myBasket_check',
|
|
this._onBasketCheck.bind(this, callback));
|
|
},
|
|
|
|
_onBasketCheck(callback, resultSet) {
|
|
var status = resultSet.fetchValue();
|
|
|
|
if (!status)
|
|
return;
|
|
|
|
var isOk = status == 'UPDATED' || status == 'OK';
|
|
|
|
if (status == 'UPDATED')
|
|
Htk.Toast.showWarning(_('Order items updated'));
|
|
if (callback)
|
|
callback(isOk);
|
|
if (!isOk)
|
|
this.hash.setAll({form: 'ecomerce/checkout'});
|
|
}
|
|
};
|
|
|