{
"formFields": [],
"otherFields": [],
"tableFields": []
}
export const getFields = () => {
return axios.get(config.endPoint + '/kasko/fields.json')
.then(({
data
}) => {
if (data.errors) throw new Error(data.errors);
return data;
})
};
getFields({ commit }) {
getFields().then(response => {
let formFields = response.formFields.map(n => ({ ...n, value: '' }))
let otherFields = response.otherFields.map(n => ({ ...n, value: '' }))
let tableFields = response.tableFields.map(n => ({ ...n, value: '' }))
commit(SET_FIELDS_TRANSPORT, formFields);
commit(SET_FIELDS_OTHER, otherFields);
commit(SET_FIELDS_TABLE, tableFields);
}).catch(errors => {
console.error(errors);
});
},
[SET_FIELDS_TRANSPORT](state, payload) {
state.FIELDS.formFields = payload;
},
[SET_FIELDS_OTHER](state, payload) {
state.FIELDS.otherFields = payload;
},
[SET_FIELDS_TABLE](state, payload) {
state.FIELDS.tableFields = payload;
},
Error in callback for watcher "function () { return this._data.$$state }": "Error: [vuex] Do not mutate vuex store state outside mutation handlers."
'formData.brand'(val) {
axios.get('../../../static/json/v1/models/' + val + '.json').then(response => {
this.dependentData.brand = {
model: response.data.models,
country: response.data.city
}
}).catch(errors => {
console.error(errors);
});
}
Cannot read property 'model' of undefined"
Или например как-то сделать, чтоб когда на боевом делаешь git pull подтягивались уже данные с теста?