aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/api-documentation/list.js
blob: 102fc71189f21bc5e2e5eb3ddb064bec541e64e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import _ from 'underscore';
import Backbone from 'backbone';

export default Backbone.Collection.extend({
  url: baseUrl + '/api/webservices/list',
  comparator: 'path',

  parse: function (r) {
    return r.webServices.map(function (webService) {
      var internal = _.every(webService.actions, function (action) {
            return action.internal;
          }),
          actions = webService.actions.map(function (action) {
            return _.extend(action, { path: webService.path });
          });
      return _.extend(webService, {
        internal: internal,
        actions: actions
      });
    });
  }
});