From 1edb28db43bc850acbadddaf1603b7dec31dc8a1 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sat, 8 Jan 2022 20:08:11 -0500 Subject: [PATCH] Attempt to add toast to individual view --- Open-ILS/web/js/ui/default/staff/cat/item/app.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js index 0a9371ad1d..7346e2a922 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js @@ -52,8 +52,8 @@ angular.module('egItemStatus', * 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 @@ -156,6 +156,11 @@ function($scope , $q , $window , $location , $timeout , egCore , egNet , egGridD $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); }); } -- 2.11.0