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

View File

@ -81,13 +81,13 @@
} }
}, },
created() { created() {
if (this.metadatumType === 'Tainacan\\Metadata_Types\\Relationship' && if (this.filter.metadatum &&
this.filter.metadatum &&
this.filter.metadatum.metadata_type_object && this.filter.metadatum.metadata_type_object &&
this.filter.metadatum.metadata_type_object.options && 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.filter.metadatum.metadata_type_object.options.taxonomy_id) {
this.taxonomyId = 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(){ mounted(){

View File

@ -44,13 +44,13 @@
export default { export default {
mixins: [ filterTypeMixin, dynamicFilterTypeMixin ], mixins: [ filterTypeMixin, dynamicFilterTypeMixin ],
created() { created() {
if (this.metadatumType === 'Tainacan\\Metadata_Types\\Relationship' && if (this.filter.metadatum &&
this.filter.metadatum &&
this.filter.metadatum.metadata_type_object && this.filter.metadatum.metadata_type_object &&
this.filter.metadatum.metadata_type_object.options && 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.filter.metadatum.metadata_type_object.options.taxonomy_id) {
this.taxonomyId = 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: { watch: {

View File

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