diff --git a/src/js/store/modules/fields/actions.js b/src/js/store/modules/fields/actions.js index fffbbe909..10227d594 100644 --- a/src/js/store/modules/fields/actions.js +++ b/src/js/store/modules/fields/actions.js @@ -145,6 +145,19 @@ export const fetchFieldMappers = ({commit}) => { }); } -export const updateFieldMappers = ({commit}, fieldMappers) => { - commit('setFieldMappers', fieldMappers); +export const updateFieldsMapperMetadata = ({ dispatch }, fieldsMapperMetadata, mapper) => { + return new Promise((resolve, reject) => { + axios.tainacan.post('/field-mappers', { + fields_mappers: fieldsMapperMetadata, + "exposer-map": mapper + }).then((res) => { + resolve(res.data); + }) + .catch((error) => { + console.log(error); + reject(error); + }); + }); }; + +