diff options
Diffstat (limited to 'app/assets/javascripts/user_lists/store')
8 files changed, 14 insertions, 13 deletions
diff --git a/app/assets/javascripts/user_lists/store/edit/actions.js b/app/assets/javascripts/user_lists/store/edit/actions.js index 8f0a2bafec7..6db2e65cf04 100644 --- a/app/assets/javascripts/user_lists/store/edit/actions.js +++ b/app/assets/javascripts/user_lists/store/edit/actions.js @@ -7,7 +7,7 @@ export const fetchUserList = ({ commit, state }) => { commit(types.REQUEST_USER_LIST); return Api.fetchFeatureFlagUserList(state.projectId, state.userListIid) .then(({ data }) => commit(types.RECEIVE_USER_LIST_SUCCESS, data)) - .catch(response => commit(types.RECEIVE_USER_LIST_ERROR, getErrorMessages(response))); + .catch((response) => commit(types.RECEIVE_USER_LIST_ERROR, getErrorMessages(response))); }; export const dismissErrorAlert = ({ commit }) => commit(types.DISMISS_ERROR_ALERT); @@ -18,5 +18,5 @@ export const updateUserList = ({ commit, state }, userList) => { name: userList.name, }) .then(({ data }) => redirectTo(data.path)) - .catch(response => commit(types.RECEIVE_USER_LIST_ERROR, getErrorMessages(response))); + .catch((response) => commit(types.RECEIVE_USER_LIST_ERROR, getErrorMessages(response))); }; diff --git a/app/assets/javascripts/user_lists/store/edit/index.js b/app/assets/javascripts/user_lists/store/edit/index.js index b30b0b04b9e..3b19b2b12ec 100644 --- a/app/assets/javascripts/user_lists/store/edit/index.js +++ b/app/assets/javascripts/user_lists/store/edit/index.js @@ -3,7 +3,7 @@ import createState from './state'; import * as actions from './actions'; import mutations from './mutations'; -export default initialState => +export default (initialState) => new Vuex.Store({ actions, mutations, diff --git a/app/assets/javascripts/user_lists/store/new/actions.js b/app/assets/javascripts/user_lists/store/new/actions.js index 185508bcfbc..478fca40142 100644 --- a/app/assets/javascripts/user_lists/store/new/actions.js +++ b/app/assets/javascripts/user_lists/store/new/actions.js @@ -11,5 +11,5 @@ export const createUserList = ({ commit, state }, userList) => { ...userList, }) .then(({ data }) => redirectTo(data.path)) - .catch(response => commit(types.RECEIVE_CREATE_USER_LIST_ERROR, getErrorMessages(response))); + .catch((response) => commit(types.RECEIVE_CREATE_USER_LIST_ERROR, getErrorMessages(response))); }; diff --git a/app/assets/javascripts/user_lists/store/new/index.js b/app/assets/javascripts/user_lists/store/new/index.js index b30b0b04b9e..3b19b2b12ec 100644 --- a/app/assets/javascripts/user_lists/store/new/index.js +++ b/app/assets/javascripts/user_lists/store/new/index.js @@ -3,7 +3,7 @@ import createState from './state'; import * as actions from './actions'; import mutations from './mutations'; -export default initialState => +export default (initialState) => new Vuex.Store({ actions, mutations, diff --git a/app/assets/javascripts/user_lists/store/show/actions.js b/app/assets/javascripts/user_lists/store/show/actions.js index 15b971aa5e8..dcd57efc146 100644 --- a/app/assets/javascripts/user_lists/store/show/actions.js +++ b/app/assets/javascripts/user_lists/store/show/actions.js @@ -5,7 +5,7 @@ import * as types from './mutation_types'; export const fetchUserList = ({ commit, state }) => { commit(types.REQUEST_USER_LIST); return Api.fetchFeatureFlagUserList(state.projectId, state.userListIid) - .then(response => commit(types.RECEIVE_USER_LIST_SUCCESS, response.data)) + .then((response) => commit(types.RECEIVE_USER_LIST_SUCCESS, response.data)) .catch(() => commit(types.RECEIVE_USER_LIST_ERROR)); }; @@ -27,6 +27,6 @@ export const updateUserList = ({ commit, state }) => { ...state.userList, user_xids: stringifyUserIds(state.userIds), }) - .then(response => commit(types.RECEIVE_USER_LIST_SUCCESS, response.data)) + .then((response) => commit(types.RECEIVE_USER_LIST_SUCCESS, response.data)) .catch(() => commit(types.RECEIVE_USER_LIST_ERROR)); }; diff --git a/app/assets/javascripts/user_lists/store/show/index.js b/app/assets/javascripts/user_lists/store/show/index.js index b30b0b04b9e..3b19b2b12ec 100644 --- a/app/assets/javascripts/user_lists/store/show/index.js +++ b/app/assets/javascripts/user_lists/store/show/index.js @@ -3,7 +3,7 @@ import createState from './state'; import * as actions from './actions'; import mutations from './mutations'; -export default initialState => +export default (initialState) => new Vuex.Store({ actions, mutations, diff --git a/app/assets/javascripts/user_lists/store/show/mutations.js b/app/assets/javascripts/user_lists/store/show/mutations.js index c3e766465a7..3cf3b2d8371 100644 --- a/app/assets/javascripts/user_lists/store/show/mutations.js +++ b/app/assets/javascripts/user_lists/store/show/mutations.js @@ -20,10 +20,10 @@ export default { [types.ADD_USER_IDS](state, ids) { state.userIds = [ ...state.userIds, - ...parseUserIds(ids).filter(id => id && !state.userIds.includes(id)), + ...parseUserIds(ids).filter((id) => id && !state.userIds.includes(id)), ]; }, [types.REMOVE_USER_ID](state, id) { - state.userIds = state.userIds.filter(uid => uid !== id); + state.userIds = state.userIds.filter((uid) => uid !== id); }, }; diff --git a/app/assets/javascripts/user_lists/store/utils.js b/app/assets/javascripts/user_lists/store/utils.js index f4e46947759..16f510bc32d 100644 --- a/app/assets/javascripts/user_lists/store/utils.js +++ b/app/assets/javascripts/user_lists/store/utils.js @@ -1,5 +1,6 @@ -export const parseUserIds = userIds => userIds.split(/\s*,\s*/g); +export const parseUserIds = (userIds) => userIds.split(/\s*,\s*/g); -export const stringifyUserIds = userIds => userIds.join(','); +export const stringifyUserIds = (userIds) => userIds.join(','); -export const getErrorMessages = error => [].concat(error?.response?.data?.message ?? error.message); +export const getErrorMessages = (error) => + [].concat(error?.response?.data?.message ?? error.message); |