aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/api/rules.ts
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2017-09-26 14:41:01 +0200
committerStas Vilchik <stas.vilchik@sonarsource.com>2017-10-02 17:18:15 +0200
commit6a3ae4ac87b1e12a9bcd496c57bb6e2918cc345e (patch)
tree38f63a05fdf9797438a600544a3fdacd789c7615 /server/sonar-web/src/main/js/api/rules.ts
parent77d3e365acbfd9095efe4458c643a9e8ccdada13 (diff)
downloadsonarqube-6a3ae4ac87b1e12a9bcd496c57bb6e2918cc345e.tar.gz
sonarqube-6a3ae4ac87b1e12a9bcd496c57bb6e2918cc345e.zip
SONAR-1330 Allow rule changes only for quality profile admins
Diffstat (limited to 'server/sonar-web/src/main/js/api/rules.ts')
-rw-r--r--server/sonar-web/src/main/js/api/rules.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/api/rules.ts b/server/sonar-web/src/main/js/api/rules.ts
index 20a0b26f5a2..ded000324d1 100644
--- a/server/sonar-web/src/main/js/api/rules.ts
+++ b/server/sonar-web/src/main/js/api/rules.ts
@@ -18,6 +18,15 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import { getJSON, RequestData } from '../helpers/request';
+import throwGlobalError from '../app/utils/throwGlobalError';
+
+export interface GetRulesAppResponse {
+ respositories: Array<{ key: string; language: string; name: string }>;
+}
+
+export function getRulesApp(): Promise<GetRulesAppResponse> {
+ return getJSON('/api/rules/app').catch(throwGlobalError);
+}
export function searchRules(data: RequestData) {
return getJSON('/api/rules/search', data);