diff options
Diffstat (limited to 'app/assets/javascripts/add_context_commits_modal/store')
-rw-r--r-- | app/assets/javascripts/add_context_commits_modal/store/actions.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/assets/javascripts/add_context_commits_modal/store/actions.js b/app/assets/javascripts/add_context_commits_modal/store/actions.js index d23955182b2..1bf54b159ee 100644 --- a/app/assets/javascripts/add_context_commits_modal/store/actions.js +++ b/app/assets/javascripts/add_context_commits_modal/store/actions.js @@ -27,10 +27,10 @@ export const searchCommits = ({ dispatch, commit, state }, searchText) => { return axios .get(state.contextCommitsPath, params) .then(({ data }) => { - let commits = data.map(o => ({ ...o, isSelected: false })); - commits = commits.map(c => { + let commits = data.map((o) => ({ ...o, isSelected: false })); + commits = commits.map((c) => { const isPresent = state.selectedCommits.find( - selectedCommit => selectedCommit.short_id === c.short_id && selectedCommit.isSelected, + (selectedCommit) => selectedCommit.short_id === c.short_id && selectedCommit.isSelected, ); if (isPresent) { return { ...c, isSelected: true }; @@ -50,7 +50,7 @@ export const searchCommits = ({ dispatch, commit, state }, searchText) => { export const setCommits = ({ commit }, { commits: data, silentAddition = false }) => { let commits = _.uniqBy(data, 'short_id'); - commits = _.orderBy(data, c => new Date(c.committed_date), ['desc']); + commits = _.orderBy(data, (c) => new Date(c.committed_date), ['desc']); if (silentAddition) { commit(types.SET_COMMITS_SILENT, commits); } else { @@ -60,7 +60,7 @@ export const setCommits = ({ commit }, { commits: data, silentAddition = false } export const createContextCommits = ({ state }, { commits, forceReload = false }) => Api.createContextCommits(state.projectId, state.mergeRequestIid, { - commits: commits.map(commit => commit.short_id), + commits: commits.map((commit) => commit.short_id), }) .then(() => { if (forceReload) { @@ -81,7 +81,7 @@ export const fetchContextCommits = ({ dispatch, commit, state }) => { commit(types.FETCH_CONTEXT_COMMITS); return Api.allContextCommits(state.projectId, state.mergeRequestIid) .then(({ data }) => { - const contextCommits = data.map(o => ({ ...o, isSelected: true })); + const contextCommits = data.map((o) => ({ ...o, isSelected: true })); dispatch('setContextCommits', contextCommits); dispatch('setCommits', { commits: [...state.commits, ...contextCommits], @@ -121,7 +121,7 @@ export const setSelectedCommits = ({ commit }, selected) => { let selectedCommits = _.uniqBy(selected, 'short_id'); selectedCommits = _.orderBy( selectedCommits, - selectedCommit => new Date(selectedCommit.committed_date), + (selectedCommit) => new Date(selectedCommit.committed_date), ['desc'], ); commit(types.SET_SELECTED_COMMITS, selectedCommits); |