avoid bucket fetch sans bucket id
authorBill Erickson <berick@esilibrary.com>
Tue, 29 Apr 2014 18:58:05 +0000 (14:58 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 29 Apr 2014 18:58:05 +0000 (14:58 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/staff/cat/bucket/record/app.js

index 0da8fbe..d968d9a 100644 (file)
@@ -399,8 +399,8 @@ function($scope,  $location,  $q,  $timeout,  $modal,
 }])
 
 .controller('SearchCtrl',
-       ['$scope','$routeParams','egAuth','egNet','egIDL','bucketSvc',
-function($scope,  $routeParams,  egAuth,  egNet,  egIDL,  bucketSvc) {
+       ['$scope','$routeParams','egAuth','egNet','bucketSvc',
+function($scope,  $routeParams,  egAuth,  egNet,  bucketSvc) {
 
     $scope.setTab('search');
     $scope.focusMe = true;
@@ -525,5 +525,6 @@ function($scope,  $q , $routeParams,  bucketSvc) {
     }
 
     // fetch the bucket;  on error show the not-allowed message
-    drawBucket()['catch'](function() { $scope.forbidden = true });
+    if ($scope.bucketId) 
+        drawBucket()['catch'](function() { $scope.forbidden = true });
 }])