aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/api
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-12-01 14:29:02 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-12-01 14:29:02 +0100
commit6e07fc504ca021d21c54f504fc1a815bd76dc0c8 (patch)
treef4b143ddce40e52fc095b656bf7c4df42207ad1d /server/sonar-web/src/main/js/api
parentbba16edb777a69137b3122dfbc5b898049f274c5 (diff)
downloadsonarqube-6e07fc504ca021d21c54f504fc1a815bd76dc0c8.tar.gz
sonarqube-6e07fc504ca021d21c54f504fc1a815bd76dc0c8.zip
SONAR-7063 Show events history in the project overview page
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r--server/sonar-web/src/main/js/api/events.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/api/events.js b/server/sonar-web/src/main/js/api/events.js
index 11852bef775..23c15b9c9ee 100644
--- a/server/sonar-web/src/main/js/api/events.js
+++ b/server/sonar-web/src/main/js/api/events.js
@@ -1,7 +1,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) {
let url = baseUrl + '/api/events';
- let data = { resource: componentKey, categories };
+ let data = { resource: componentKey };
+ if (categories) {
+ data.categories = categories;
+ }
return getJSON(url, data);
}