* Parent scope for list and detail views
*/
.controller('SearchCtrl',
- ['$scope','$q','$window','$location','$timeout','egCore','egNet','egGridDataProvider','egItem', 'egCirc',
-function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridDataProvider , itemSvc , egCirc) {
+ ['$scope','$q','$window','$location','$timeout','egCore','egNet','egGridDataProvider','egItem', 'egCirc', 'ngToast',
+function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridDataProvider , itemSvc , egCirc, ngToast) {
$scope.args = {}; // search args
// sub-scopes (search / detail-view) apply their version
$scope.update_inventory = function() {
itemSvc.updateInventory([$scope.args.copyId], null)
.then(function(res) {
+ if (res[0]) {
+ ngToast.create(egCore.strings.SUCCESS_UPDATE_INVENTORY);
+ } else {
+ ngToast.warning(egCore.strings.FAIL_UPDATE_INVENTORY);
+ }
$timeout(function() { location.href = location.href; }, 1000);
});
}