API explorer - fix getfields action select
[civicrm-core.git] / templates / CRM / Admin / Page / APIExplorer.js
index e530b27a49b566139fc6d036690e2db7d7c3d1e4..2df88070abb5023b0299d21c98c478f4516055bb 100644 (file)
         id: 'api_action',
         text: 'Action'
       });
-      options.api_action = [];
-      $('option', '#api-action').each(function() {
-        if (this.value) {
-          options.api_action.push({key: this.value, value: $(this).text()});
-        }
-      });
+      options.api_action = _.transform(actions, function(ret, item) {ret.push({value: item, key: item})});
       showFields(['api_action']);
       return;
     }