diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-08-10 18:16:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-10 18:16:54 +0200 |
commit | c12f3d56cb99478c36242fd122258ebf0d26f740 (patch) | |
tree | 2a7cae9094a9773bf5ba621bb3214f52c2c6126d /server/sonar-web/src/main/js/api | |
parent | 6d55c79eed10aefdda9381cb82acdac47c824ec6 (diff) | |
download | sonarqube-c12f3d56cb99478c36242fd122258ebf0d26f740.tar.gz sonarqube-c12f3d56cb99478c36242fd122258ebf0d26f740.zip |
SONAR-7919 Rewrite "Update Key" project page (#1140)
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r-- | server/sonar-web/src/main/js/api/components.js | 26 |
1 files changed, 26 insertions, 0 deletions
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); +} |