aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/api/events.js
blob: 20eb0054d91d089f3b5515cd35fffa3648cffd56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { getJSON } from '../helpers/request.js';


/**
 * Return events for a component
 * @param {string} componentKey
 * @param {string} [categories]
 * @returns {Promise}
 */
export function getEvents (componentKey, categories) {
  const url = baseUrl + '/api/events';
  const data = { resource: componentKey };
  if (categories) {
    data.categories = categories;
  }
  return getJSON(url, data);
}