diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2017-03-14 09:43:28 +0100 |
---|---|---|
committer | Stas Vilchik <stas-vilchik@users.noreply.github.com> | 2017-03-14 10:39:38 +0100 |
commit | effef8dfdb3a0aa0c6dc36f891f62b354647221e (patch) | |
tree | 9549bf2c57daecc6888b4894b6dd724ec63dc7ce /server/sonar-web/src/main/js/api | |
parent | 05dde8a5edeb63a8e8122b2d07ffa598dd7fe41d (diff) | |
download | sonarqube-effef8dfdb3a0aa0c6dc36f891f62b354647221e.tar.gz sonarqube-effef8dfdb3a0aa0c6dc36f891f62b354647221e.zip |
SONAR-8800 remove usages of deprecated api
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r-- | server/sonar-web/src/main/js/api/components.js | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/api/components.js b/server/sonar-web/src/main/js/api/components.js index c09192522e3..456cb90e0e5 100644 --- a/server/sonar-web/src/main/js/api/components.js +++ b/server/sonar-web/src/main/js/api/components.js @@ -35,18 +35,23 @@ export function getGhosts (data?: Object) { return getJSON(url, data); } -export function deleteComponents (data?: Object) { +export function deleteComponents (data: { projects: string, organization?: string }) { const url = '/api/projects/bulk_delete'; return post(url, data); } -export function deleteProject (key: string) { +export function deleteProject (project: string) { const url = '/api/projects/delete'; - const data = { key }; + const data = { project }; return post(url, data); } -export function createProject (data?: Object) { +export function createProject (data: { + branch?: string, + name: string, + project: string, + organization?: string +}) { const url = '/api/projects/create'; return postJSON(url, data); } @@ -80,9 +85,9 @@ export function getComponent (componentKey: string, metrics: Array<string> = []) return getJSON(url, data).then(r => r.component); } -export function getTree (baseComponentKey: string, options?: Object = {}) { +export function getTree (component: string, options?: Object = {}) { const url = '/api/components/tree'; - const data = Object.assign({}, options, { baseComponentKey }); + const data = { ...options, component }; return getJSON(url, data); } @@ -92,10 +97,9 @@ export function getParents ({ id, key }: { id: string, key: string }) { return getJSON(url, data).then(r => r.ancestors); } -export function getBreadcrumbs ({ id, key }: { id: string, key: string }) { +export function getBreadcrumbs (component: string) { const url = '/api/components/show'; - const data = id ? { id } : { key }; - return getJSON(url, data).then(r => { + return getJSON(url, { component }).then(r => { const reversedAncestors = [...r.ancestors].reverse(); return [...reversedAncestors, r.component]; }); |