diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2018-11-09 14:44:07 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-11-16 20:21:06 +0100 |
commit | e86e8c1fe6f96ea84d2f38ee01b3610d21eebe94 (patch) | |
tree | c3cc3465112ccff2055867a4b143664ed9108f1f /server/sonar-web/src/main/js/api | |
parent | 4e72416a414f4651cf9e0347b161c9be74b9782a (diff) | |
download | sonarqube-e86e8c1fe6f96ea84d2f38ee01b3610d21eebe94.tar.gz sonarqube-e86e8c1fe6f96ea84d2f38ee01b3610d21eebe94.zip |
SONAR-11321 Improve project page manual fields validate
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r-- | server/sonar-web/src/main/js/api/components.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/api/components.ts b/server/sonar-web/src/main/js/api/components.ts index df793ee8a87..ae01e608b7b 100644 --- a/server/sonar-web/src/main/js/api/components.ts +++ b/server/sonar-web/src/main/js/api/components.ts @@ -164,6 +164,15 @@ export function getTree(data: { return getJSON('/api/components/tree', data).catch(throwGlobalError); } +export function doesComponentExists( + data: { component: string } & BranchParameters +): Promise<boolean> { + return getJSON('/api/components/show', data).then( + ({ component }) => component !== undefined, + () => false + ); +} + export function getComponentShow(data: { component: string } & BranchParameters): Promise<any> { return getJSON('/api/components/show', data).catch(throwGlobalError); } |