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

28 lines
507 B
JavaScript
Raw Normal View History

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