Commit f275366f authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Minor maintainer review feedback

parent b960a114
......@@ -299,9 +299,7 @@ export default {
/>
</template>
<template v-if="customStageFormActive" #content>
<div v-if="isUpdatingCustomStage">
<gl-loading-icon class="mt-4" size="md" />
</div>
<gl-loading-icon v-if="isUpdatingCustomStage" class="mt-4" size="md" />
<custom-stage-form
v-else
:events="formEvents"
......
......@@ -123,7 +123,7 @@ export const receiveGroupStagesError = ({ commit }, error) => {
export const setDefaultSelectedStage = ({ dispatch, getters }) => {
const { activeStages = [] } = getters;
if (activeStages && activeStages.length) {
if (activeStages?.length) {
const [firstActiveStage] = activeStages;
return Promise.all([
dispatch('setSelectedStage', firstActiveStage),
......
import Api from 'ee/api';
import createFlash from '~/flash';
import { __, sprintf } from '~/locale';
import httpStatusCodes from '~/lib/utils/http_status';
import * as types from './mutation_types';
import { removeFlash, isStageNameExistsError } from '../../../utils';
......@@ -48,7 +49,7 @@ export const receiveCreateStageSuccess = ({ commit, dispatch }, { data: { title
export const receiveCreateStageError = (
{ commit, dispatch },
{ status = 400, errors = {}, data = {} } = {},
{ status = httpStatusCodes.BAD_REQUEST, errors = {}, data = {} } = {},
) => {
commit(types.RECEIVE_CREATE_STAGE_ERROR);
const { name = null } = data;
......@@ -75,7 +76,7 @@ export const createStage = ({ dispatch, rootState }, data) => {
return dispatch('receiveCreateStageSuccess', { status, data: responseData });
})
.catch(({ response } = {}) => {
const { data: { message, errors } = null, status = 400 } = response;
const { data: { message, errors } = null, status = httpStatusCodes.BAD_REQUEST } = response;
dispatch('receiveCreateStageError', { data, message, errors, status });
});
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment