aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/api/rules.ts
diff options
context:
space:
mode:
authorphilippe-perrin-sonarsource <philippe.perrin@sonarsource.com>2022-01-27 11:06:59 +0100
committersonartech <sonartech@sonarsource.com>2022-01-27 20:03:05 +0000
commitdca8354af94e9feb46ea2312857e000aaa232372 (patch)
tree336b645749ab1fb1b1abdac19a69c70257e98b68 /server/sonar-web/src/main/js/api/rules.ts
parent85f744be340d8f404978341186dd77cc05584f31 (diff)
downloadsonarqube-dca8354af94e9feb46ea2312857e000aaa232372.tar.gz
sonarqube-dca8354af94e9feb46ea2312857e000aaa232372.zip
SONAR-15945 Get rid of T namespace in sonar-web
Diffstat (limited to 'server/sonar-web/src/main/js/api/rules.ts')
-rw-r--r--server/sonar-web/src/main/js/api/rules.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/api/rules.ts b/server/sonar-web/src/main/js/api/rules.ts
index cf22ee7fbcb..1fae18f0649 100644
--- a/server/sonar-web/src/main/js/api/rules.ts
+++ b/server/sonar-web/src/main/js/api/rules.ts
@@ -20,6 +20,7 @@
import throwGlobalError from '../app/utils/throwGlobalError';
import { getJSON, post, postJSON } from '../helpers/request';
import { GetRulesAppResponse, SearchRulesResponse } from '../types/coding-rules';
+import { RuleActivation, RuleDetails } from '../types/types';
export function getRulesApp(): Promise<GetRulesAppResponse> {
return getJSON('/api/rules/app').catch(throwGlobalError);
@@ -73,7 +74,7 @@ export function getRuleRepositories(parameters: {
export function getRuleDetails(parameters: {
actives?: boolean;
key: string;
-}): Promise<{ actives?: T.RuleActivation[]; rule: T.RuleDetails }> {
+}): Promise<{ actives?: RuleActivation[]; rule: RuleDetails }> {
return getJSON('/api/rules/show', parameters).catch(throwGlobalError);
}
@@ -91,7 +92,7 @@ export function createRule(data: {
status?: string;
template_key: string;
type?: string;
-}): Promise<T.RuleDetails> {
+}): Promise<RuleDetails> {
return postJSON('/api/rules/create', data).then(
r => r.rule,
response => {
@@ -122,6 +123,6 @@ export function updateRule(data: {
severity?: string;
status?: string;
tags?: string;
-}): Promise<T.RuleDetails> {
+}): Promise<RuleDetails> {
return postJSON('/api/rules/update', data).then(r => r.rule, throwGlobalError);
}