Removes console log and updates taxonomy filters.

This commit is contained in:
Mateus Machado Luna 2019-10-16 11:41:12 -03:00
parent 3f0bb33091
commit a459d23cc2
4 changed files with 8 additions and 9 deletions

View File

@ -116,12 +116,12 @@
if ( this.metadatumType === 'Tainacan\\Metadata_Types\\Relationship' ) {
let query = qs.stringify({ postin: metadata.value, fetch_only: 'title,thumbnail', fetch_only_meta: '' });
let endpoint = '/items/' + metadata.value;
let endpoint = '/items/';
if (this.relatedCollectionId != '')
endpoint = '/collection/' + this.relatedCollectionId + endpoint;
axios.get(endpoint + query)
axios.get(endpoint + '?' + query)
.then( res => {
if (res.data.items) {
this.selected = [];

View File

@ -81,13 +81,13 @@
}
},
created() {
if (this.metadatumType === 'Tainacan\\Metadata_Types\\Relationship' &&
this.filter.metadatum &&
if (this.filter.metadatum &&
this.filter.metadatum.metadata_type_object &&
this.filter.metadatum.metadata_type_object.options &&
this.filter.metadatum.metadata_type_object.options.taxonomy &&
this.filter.metadatum.metadata_type_object.options.taxonomy_id) {
this.taxonomyId = this.filter.metadatum.metadata_type_object.options.taxonomy_id;
this.taxonomy = 'tnc_tax_' + this.taxonomyId;
this.taxonomy = this.filter.metadatum.metadata_type_object.options.taxonomy;
}
},
mounted(){

View File

@ -44,13 +44,13 @@
export default {
mixins: [ filterTypeMixin, dynamicFilterTypeMixin ],
created() {
if (this.metadatumType === 'Tainacan\\Metadata_Types\\Relationship' &&
this.filter.metadatum &&
if (this.filter.metadatum &&
this.filter.metadatum.metadata_type_object &&
this.filter.metadatum.metadata_type_object.options &&
this.filter.metadatum.metadata_type_object.options.taxonomy &&
this.filter.metadatum.metadata_type_object.options.taxonomy_id) {
this.taxonomyId = this.filter.metadatum.metadata_type_object.options.taxonomy_id;
this.taxonomy = 'tnc_tax_' + this.taxonomyId;
this.taxonomy = this.filter.metadatum.metadata_type_object.options.taxonomy;
}
},
watch: {

View File

@ -36,7 +36,6 @@ export const addMetaQuery = ( state, filter ) => {
compare: filter.compare,
type: filter.type
});
console.log(state.postquery.metaquery);
}
};