lp 1844365 patron edit page stat cat persisting old data
authorMike Risher <mrisher@catalyte.io>
Mon, 24 Feb 2020 23:05:25 +0000 (23:05 +0000)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 26 Feb 2020 19:25:13 +0000 (14:25 -0500)
Fix the bug on the patron edit page where old stat cat data is
persisting when one does a new patron search and loads a patron
with no stat cats.

Signed-off-by: Mike Risher <mrisher@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/circ/patron/app.js

Open-ILS/web/js/ui/default/staff/circ/patron/app.js

index 0d8f25f..44b0b7f 100644 (file)
@@ -612,9 +612,11 @@ function($scope , $location , egCore , egConfirmDialog , egUser , patronSvc , $u
        ['$scope','$q','$routeParams','$timeout','$window','$location','egCore','ngToast',
        '$filter','egUser', 'patronSvc','egGridDataProvider','$document','bucketSvc',
        'egPatronMerge','egProgressDialog','$controller','$interpolate','$uibModal',
+       'patronRegSvc',
 function($scope,  $q,  $routeParams,  $timeout,  $window,  $location,  egCore , ngToast,
          $filter,  egUser,  patronSvc , egGridDataProvider , $document , bucketSvc,
-        egPatronMerge , egProgressDialog , $controller , $interpolate , $uibModal) {
+        egPatronMerge , egProgressDialog , $controller , $interpolate , $uibModal,
+        patronRegSvc ) {
 
     angular.extend(this, $controller('BasePatronSearchCtrl', {$scope : $scope}));
     $scope.initTab('search');
@@ -626,6 +628,9 @@ function($scope,  $q,  $routeParams,  $timeout,  $window,  $location,  egCore ,
         selectedItems : function() { return [] }
     }
 
+    // reset the stat_cats or there's a risk previous patron's data data will persist
+    patronRegSvc.stat_cat_entry_maps = {};
+
     $scope.bucketSvc = bucketSvc;
     $scope.bucketSvc.fetchUserBuckets();
     $scope.addToBucket = function(item, data, recs) {