2020-03-13 15:44:24 +05:30
|
|
|
import * as types from './mutation_types';
|
|
|
|
|
|
|
|
export default {
|
2020-04-22 19:07:51 +05:30
|
|
|
[types.SET_INITIAL_DATA](state, { blobs, definitionPathPrefix }) {
|
|
|
|
state.blobs = blobs;
|
|
|
|
state.definitionPathPrefix = definitionPathPrefix;
|
2020-03-13 15:44:24 +05:30
|
|
|
},
|
|
|
|
[types.REQUEST_DATA](state) {
|
|
|
|
state.loading = true;
|
|
|
|
},
|
2020-04-22 19:07:51 +05:30
|
|
|
[types.REQUEST_DATA_SUCCESS](state, { path, normalizedData }) {
|
2020-03-13 15:44:24 +05:30
|
|
|
state.loading = false;
|
2020-04-22 19:07:51 +05:30
|
|
|
state.data = { ...state.data, [path]: normalizedData };
|
2020-03-13 15:44:24 +05:30
|
|
|
},
|
|
|
|
[types.REQUEST_DATA_ERROR](state) {
|
|
|
|
state.loading = false;
|
|
|
|
},
|
|
|
|
[types.SET_CURRENT_DEFINITION](state, { definition, position }) {
|
|
|
|
state.currentDefinition = definition;
|
|
|
|
state.currentDefinitionPosition = position;
|
|
|
|
},
|
|
|
|
};
|