field-mapper action

This commit is contained in:
Jacson Passold 2018-06-11 18:11:34 -03:00
parent 5d83faf44b
commit 3e8e146c56
1 changed files with 15 additions and 2 deletions

View File

@ -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);
});
});
};