Ensure that API Explorer passes through necessary header
authorSeamus Lee <seamuslee001@gmail.com>
Thu, 28 Nov 2019 23:03:00 +0000 (10:03 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Wed, 4 Dec 2019 19:59:08 +0000 (06:59 +1100)
ang/api4Explorer/Explorer.js

index 5ecf08d362b48cfebdbc3ff88339b50627638055..a626e572dca9cb6160d5d4ad1bdf675c6df6ae3c 100644 (file)
       $http.get(CRM.url('civicrm/ajax/api4/' + $scope.entity + '/' + $scope.action, {
         params: angular.toJson(getParams()),
         index: $scope.index
-      })).then(function(resp) {
+      }), {
+        headers: {
+          'X-Requested-With': 'XMLHttpRequest'
+        }
+      }).then(function(resp) {
           $scope.loading = false;
           $scope.status = 'success';
           $scope.result = [formatMeta(resp.data), prettyPrintOne(JSON.stringify(resp.data.values, null, 2), 'js', 1)];