diff options
Diffstat (limited to 'server/sonar-web/src/main/js/api/quality-gates.ts')
-rw-r--r-- | server/sonar-web/src/main/js/api/quality-gates.ts | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/api/quality-gates.ts b/server/sonar-web/src/main/js/api/quality-gates.ts index af49578283e..cd47f7709e3 100644 --- a/server/sonar-web/src/main/js/api/quality-gates.ts +++ b/server/sonar-web/src/main/js/api/quality-gates.ts @@ -19,13 +19,12 @@ */ import { getJSON, post, postJSON } from '../helpers/request'; import throwGlobalError from '../app/utils/throwGlobalError'; -import { Condition, Metric, QualityGate, Omit } from '../app/types'; export function fetchQualityGates(data: { organization?: string; }): Promise<{ actions: { create: boolean }; - qualitygates: QualityGate[]; + qualitygates: T.QualityGate[]; }> { return getJSON('/api/qualitygates/list', data).catch(throwGlobalError); } @@ -33,14 +32,14 @@ export function fetchQualityGates(data: { export function fetchQualityGate(data: { id: number; organization?: string; -}): Promise<QualityGate> { +}): Promise<T.QualityGate> { return getJSON('/api/qualitygates/show', data).catch(throwGlobalError); } export function createQualityGate(data: { name: string; organization?: string; -}): Promise<QualityGate> { +}): Promise<T.QualityGate> { return postJSON('/api/qualitygates/create', data).catch(throwGlobalError); } @@ -63,7 +62,7 @@ export function copyQualityGate(data: { id: number; name: string; organization?: string; -}): Promise<QualityGate> { +}): Promise<T.QualityGate> { return postJSON('/api/qualitygates/copy', data).catch(throwGlobalError); } @@ -78,12 +77,14 @@ export function createCondition( data: { gateId: number; organization?: string; - } & Omit<Condition, 'id'> -): Promise<Condition> { + } & T.Omit<T.Condition, 'id'> +): Promise<T.Condition> { return postJSON('/api/qualitygates/create_condition', data); } -export function updateCondition(data: { organization?: string } & Condition): Promise<Condition> { +export function updateCondition( + data: { organization?: string } & T.Condition +): Promise<T.Condition> { return postJSON('/api/qualitygates/update_condition', data); } @@ -94,7 +95,7 @@ export function deleteCondition(data: { id: number; organization?: string }): Pr export function getGateForProject(data: { organization?: string; project: string; -}): Promise<QualityGate | undefined> { +}): Promise<T.QualityGate | undefined> { return getJSON('/api/qualitygates/get_by_project', data).then( ({ qualityGate }) => qualityGate && { @@ -153,7 +154,7 @@ export interface ApplicationProject { } export interface ApplicationQualityGate { - metrics: Metric[]; + metrics: T.Metric[]; projects: ApplicationProject[]; status: string; } |