]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8773 Call api/projects/update_key and bulk_update_key in UI
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Mon, 20 Feb 2017 15:11:46 +0000 (16:11 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Wed, 22 Feb 2017 16:53:38 +0000 (17:53 +0100)
server/sonar-web/src/main/js/api/components.js

index 53007d59a45eb852deeeb1fed6e1dccada67c527..07ca4204d0bcd520ca5974f38361d5f39a97c368 100644 (file)
@@ -113,27 +113,27 @@ export function searchProjects (data?: Object) {
 
 /**
  * Change component's key
- * @param {string} key
- * @param {string} newKey
+ * @param {string} from
+ * @param {string} to
  * @returns {Promise}
  */
-export function changeKey (key: string, newKey: string) {
-  const url = '/api/components/update_key';
-  const data = { key, newKey };
+export function changeKey (from: string, to: string) {
+  const url = '/api/projects/update_key';
+  const data = { from, to };
   return post(url, data);
 }
 
 /**
  * Bulk change component's key
- * @param {string} key
+ * @param {string} project
  * @param {string} from
  * @param {string} to
  * @param {boolean} dryRun
  * @returns {Promise}
  */
-export function bulkChangeKey (key: string, from: string, to: string, dryRun?: boolean = false) {
-  const url = '/api/components/bulk_update_key';
-  const data = { key, from, to, dryRun };
+export function bulkChangeKey (project: string, from: string, to: string, dryRun?: boolean = false) {
+  const url = '/api/projects/bulk_update_key';
+  const data = { project, from, to, dryRun };
   return postJSON(url, data);
 }