Passes only metadatum id inside of metadatum POST in filter action.

This commit is contained in:
Mateus Machado Luna 2019-05-31 12:01:18 -03:00
parent 1656d4a2d6
commit 9109eb8c3a
4 changed files with 6 additions and 2 deletions

View File

@ -244,7 +244,7 @@ export default {
saveEdition(filter) {
if ((filter.filter_type_object && filter.filter_type_object.form_component) || filter.edit_form == '') {
// this.fillExtraFormData(this.editForm);
this.updateFilter({ filterId: filter.id, index: this.index, options: this.editForm})
.then(() => {

View File

@ -573,6 +573,7 @@ export default {
this.newFilterIndex = 0;
}
this.openedFilterId = filter.id;
// First time opening
if (this.editForms[this.openedFilterId] == undefined) {
this.editForms[this.openedFilterId] = JSON.parse(JSON.stringify(filter));

View File

@ -94,7 +94,6 @@
.catch(error => {
this.$console.log(error);
});
this.$eventBusSearch.$on('removeFromFilterTag', this.cleanSearchFromTags);
},
data(){

View File

@ -67,6 +67,10 @@ export const sendFilter = ( { commit }, { collectionId, metadatumId, name, filte
};
export const updateFilter = ( { commit }, { filterId, index, options }) => {
if (options['metadatum'] != undefined && options['metadatum']['metadatum_id'] != undefined)
options['metadatum'] = options['metadatum']['metadatum_id'];
return new Promise(( resolve, reject ) => {
let endpoint = '/filters/' + filterId;
options['context'] = 'edit';