aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-12-16 11:08:29 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-12-19 10:12:52 +0100
commitb55c11eff742dd35e273e1a3fcc79e51a89a90e2 (patch)
tree85060667ebc4b157cafac8a11b40661af4e370b4 /server/sonar-web/src/main
parent3a3bf3073419bc6c21a67965a9f8259dbb164fc6 (diff)
downloadsonarqube-b55c11eff742dd35e273e1a3fcc79e51a89a90e2.tar.gz
sonarqube-b55c11eff742dd35e273e1a3fcc79e51a89a90e2.zip
SONAR-7287 Move FavoriteService to favorite package
Diffstat (limited to 'server/sonar-web/src/main')
-rw-r--r--server/sonar-web/src/main/js/api/favorites.js4
-rw-r--r--server/sonar-web/src/main/js/components/source-viewer/header.js7
2 files changed, 6 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/api/favorites.js b/server/sonar-web/src/main/js/api/favorites.js
index 2c7149bd3c4..3bb5872aa1e 100644
--- a/server/sonar-web/src/main/js/api/favorites.js
+++ b/server/sonar-web/src/main/js/api/favorites.js
@@ -25,8 +25,8 @@ export const getFavorites = (): Promise<Object> => (
);
export function addFavorite (componentKey: string) {
- const url = '/api/favourites';
- const data = { key: componentKey };
+ const url = '/api/favorites';
+ const data = { component: componentKey };
return post(url, data);
}
diff --git a/server/sonar-web/src/main/js/components/source-viewer/header.js b/server/sonar-web/src/main/js/components/source-viewer/header.js
index 5e3ed9e866b..d0248f1a02c 100644
--- a/server/sonar-web/src/main/js/components/source-viewer/header.js
+++ b/server/sonar-web/src/main/js/components/source-viewer/header.js
@@ -25,7 +25,8 @@ import MoreActionsView from './more-actions';
import MeasuresOverlay from './measures-overlay';
import Template from './templates/source-viewer-header.hbs';
-const API_FAVORITE: string = window.baseUrl + '/api/favourites';
+const API_FAVOURITE: string = window.baseUrl + '/api/favourites';
+const API_FAVORITE: string = window.baseUrl + '/api/favorites';
export default Marionette.ItemView.extend({
template: Template,
@@ -42,7 +43,7 @@ export default Marionette.ItemView.extend({
const that = this;
if (this.model.get('fav')) {
$.ajax({
- url: API_FAVORITE + '/' + this.model.get('key'),
+ url: API_FAVOURITE + '/' + this.model.get('key'),
type: 'DELETE'
}).done(function () {
that.model.set('fav', false);
@@ -53,7 +54,7 @@ export default Marionette.ItemView.extend({
url: API_FAVORITE,
type: 'POST',
data: {
- key: this.model.get('key')
+ component: this.model.get('key')
}
}).done(function () {
that.model.set('fav', true);