js/angular-crmCaseType.js - Fix regression in promise
authorTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 00:03:24 +0000 (16:03 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 00:03:24 +0000 (16:03 -0800)
This line was written when crmApi() return jQuery-style promises. It returns
Angular-style promises.

js/angular-crmCaseType.js

index dcf752a08f94fb554d384339efcea71cc310e860..f8ae9551485c1dc873472ecf6a9b5ea8111264ab 100644 (file)
 
     $scope.save = function() {
       var result = crmApi('CaseType', 'create', $scope.caseType, true);
-      result.success(function(data) {
+      result.then(function(data) {
         if (data.is_error === 0 || data.is_error == '0') {
           $scope.caseType.id = data.id;
           window.location.href = '#/caseType';