Commit 26127fbe authored by Thomas Randolph's avatar Thomas Randolph

Add mutation to change only the diffFiles

parent c19a273b
...@@ -2,8 +2,11 @@ export const SET_BASE_CONFIG = 'SET_BASE_CONFIG'; ...@@ -2,8 +2,11 @@ export const SET_BASE_CONFIG = 'SET_BASE_CONFIG';
export const SET_LOADING = 'SET_LOADING'; export const SET_LOADING = 'SET_LOADING';
export const SET_BATCH_LOADING = 'SET_BATCH_LOADING'; export const SET_BATCH_LOADING = 'SET_BATCH_LOADING';
export const SET_RETRIEVING_BATCHES = 'SET_RETRIEVING_BATCHES'; export const SET_RETRIEVING_BATCHES = 'SET_RETRIEVING_BATCHES';
export const SET_DIFF_DATA = 'SET_DIFF_DATA'; export const SET_DIFF_DATA = 'SET_DIFF_DATA';
export const SET_DIFF_DATA_BATCH = 'SET_DIFF_DATA_BATCH'; export const SET_DIFF_DATA_BATCH = 'SET_DIFF_DATA_BATCH';
export const SET_DIFF_FILES = 'SET_DIFF_FILES';
export const SET_DIFF_VIEW_TYPE = 'SET_DIFF_VIEW_TYPE'; export const SET_DIFF_VIEW_TYPE = 'SET_DIFF_VIEW_TYPE';
export const SET_COVERAGE_DATA = 'SET_COVERAGE_DATA'; export const SET_COVERAGE_DATA = 'SET_COVERAGE_DATA';
export const SET_MERGE_REQUEST_DIFFS = 'SET_MERGE_REQUEST_DIFFS'; export const SET_MERGE_REQUEST_DIFFS = 'SET_MERGE_REQUEST_DIFFS';
......
...@@ -10,6 +10,10 @@ import { ...@@ -10,6 +10,10 @@ import {
} from './utils'; } from './utils';
import * as types from './mutation_types'; import * as types from './mutation_types';
function updateDiffFilesInState(state, files) {
return Object.assign(state, { diffFiles: files });
}
export default { export default {
[types.SET_BASE_CONFIG](state, options) { [types.SET_BASE_CONFIG](state, options) {
const { const {
...@@ -46,6 +50,10 @@ export default { ...@@ -46,6 +50,10 @@ export default {
Object.assign(state, { retrievingBatches }); Object.assign(state, { retrievingBatches });
}, },
[types.SET_DIFF_FILES](state, files) {
updateDiffFilesInState(state, files);
},
[types.SET_DIFF_DATA](state, data) { [types.SET_DIFF_DATA](state, data) {
let files = state.diffFiles; let files = state.diffFiles;
...@@ -58,8 +66,8 @@ export default { ...@@ -58,8 +66,8 @@ export default {
Object.assign(state, { Object.assign(state, {
...convertObjectPropsToCamelCase(data), ...convertObjectPropsToCamelCase(data),
diffFiles: files,
}); });
updateDiffFilesInState(state, files);
}, },
[types.SET_DIFF_DATA_BATCH](state, data) { [types.SET_DIFF_DATA_BATCH](state, data) {
...@@ -67,8 +75,8 @@ export default { ...@@ -67,8 +75,8 @@ export default {
Object.assign(state, { Object.assign(state, {
...convertObjectPropsToCamelCase(data), ...convertObjectPropsToCamelCase(data),
diffFiles: files,
}); });
updateDiffFilesInState(state, files);
}, },
[types.SET_COVERAGE_DATA](state, coverageFiles) { [types.SET_COVERAGE_DATA](state, coverageFiles) {
......
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