organization?: string;
} & T.Omit<T.Condition, 'id'>
): Promise<T.Condition> {
- return postJSON('/api/qualitygates/create_condition', data);
+ return postJSON('/api/qualitygates/create_condition', data).catch(throwGlobalError);
}
export function updateCondition(
data: { organization?: string } & T.Condition
): Promise<T.Condition> {
- return postJSON('/api/qualitygates/update_condition', data);
+ return postJSON('/api/qualitygates/update_condition', data).catch(throwGlobalError);
}
export function deleteCondition(data: { id: number; organization?: string }): Promise<void> {
import { translate, getLocalizedMetricName } from '../../../helpers/l10n';
import { createCondition, updateCondition } from '../../../api/quality-gates';
import { isDiffMetric } from '../../../helpers/measures';
-import { parseError } from '../../../helpers/request';
import ConfirmModal from '../../../components/controls/ConfirmModal';
import { Alert } from '../../../components/ui/Alert';
} else {
submitPromise = createCondition({ gateId: qualityGate.id, organization, ...newCondition });
}
- return submitPromise.then(this.props.onAddCondition, (error: any) =>
- parseError(error).then(message => {
- if (this.mounted) {
- this.setState({ errorMessage: message });
- }
- return Promise.reject(message);
- })
- );
+ return submitPromise.then(this.props.onAddCondition);
}
- return Promise.reject('No metric selected');
+ return Promise.reject();
};
handleChooseType = (metric: T.Metric) => {