From: Coleman Watts Date: Sun, 9 Jun 2019 13:10:06 +0000 (-0400) Subject: Add index to Api4Ctrl X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fdc0292a90b6d529901a730d20afcdec5001d70c;p=civicrm-core.git Add index to Api4Ctrl --- diff --git a/ext/afform/core/ang/afformCore/Api4Ctrl.js b/ext/afform/core/ang/afformCore/Api4Ctrl.js index 32ae530fd1..67fac36b4d 100644 --- a/ext/afform/core/ang/afformCore/Api4Ctrl.js +++ b/ext/afform/core/ang/afformCore/Api4Ctrl.js @@ -18,13 +18,14 @@ ctrl.entity = parts[0]; ctrl.action = parts[1]; ctrl.params = parts[2]; + ctrl.index = parts[3]; ctrl.result = {}; ctrl.loading = ctrl.firstLoad = true; ctrl.refresh = function refresh() { ctrl.loading = true; crmThrottle(function () { - return crmApi4(ctrl.entity, ctrl.action, ctrl.params) + return crmApi4(ctrl.entity, ctrl.action, ctrl.params, ctrl.index) .then(function (response) { ctrl.result = response; ctrl.loading = ctrl.firstLoad = false; @@ -39,7 +40,7 @@ var mode = $scope.affApi4Refresh ? $scope.affApi4Refresh : 'auto'; switch (mode) { - case 'auto': $scope.$watchCollection('affApi4Ctrl.params', ctrl.refresh); break; + case 'auto': $scope.$watch('affApi4Ctrl', ctrl.refresh, true); break; case 'init': ctrl.refresh(); break; case 'manual': break; default: throw 'Unrecognized refresh mode: '+ mode;