From c12f3d56cb99478c36242fd122258ebf0d26f740 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 10 Aug 2016 18:16:54 +0200 Subject: SONAR-7919 Rewrite "Update Key" project page (#1140) --- server/sonar-web/src/main/js/api/components.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'server/sonar-web/src/main/js/api') diff --git a/server/sonar-web/src/main/js/api/components.js b/server/sonar-web/src/main/js/api/components.js index f0f49a636b4..6b3238022fb 100644 --- a/server/sonar-web/src/main/js/api/components.js +++ b/server/sonar-web/src/main/js/api/components.js @@ -109,3 +109,29 @@ export function getMyProjects (data) { const url = '/api/projects/search_my_projects'; return getJSON(url, data); } + +/** + * Change component's key + * @param {string} key + * @param {string} newKey + * @returns {Promise} + */ +export function changeKey (key, newKey) { + const url = '/api/components/update_key'; + const data = { key, newKey }; + return post(url, data); +} + +/** + * Bulk change component's key + * @param {string} key + * @param {string} from + * @param {string} to + * @param {boolean} dryRun + * @returns {Promise} + */ +export function bulkChangeKey (key, from, to, dryRun = false) { + const url = '/api/components/bulk_update_key'; + const data = { key, from, to, dryRun }; + return postJSON(url, data); +} -- cgit v1.2.3