adapt filter modal for facets endpoints

This commit is contained in:
eduardohumberto 2018-08-27 20:55:16 -03:00 committed by Mateus Machado Luna
parent c95c97c8f3
commit 71a5ded568
1 changed files with 8 additions and 8 deletions

View File

@ -77,8 +77,8 @@
:key="index"> :key="index">
<b-checkbox <b-checkbox
v-model="selected" v-model="selected"
:native-value="option.id"> :native-value="option.value">
{{ `${option.name}` }} {{ `${option.label}` }}
</b-checkbox> </b-checkbox>
<a <a
v-if="option.total_children > 0" v-if="option.total_children > 0"
@ -284,7 +284,7 @@
let query = `?hideempty=0&order=asc&number=${this.maxNumSearchResultsShow}&searchterm=${this.optionName}`; let query = `?hideempty=0&order=asc&number=${this.maxNumSearchResultsShow}&searchterm=${this.optionName}`;
axios.get(`/taxonomy/${this.taxonomy_id}/terms${query}`) axios.get(`/collection/${this.collection_id}/facets/${this.metadatum_id}${query}`)
.then((res) => { .then((res) => {
this.searchResults = res.data; this.searchResults = res.data;
this.isSearchingLoading = false; this.isSearchingLoading = false;
@ -362,7 +362,7 @@
if (children.length > 0) { if (children.length > 0) {
for (let f in this.finderColumns) { for (let f in this.finderColumns) {
if (this.finderColumns[f][0].id == children[0].id) { if (this.finderColumns[f][0].value == children[0].value) {
first = f; first = f;
break; break;
} }
@ -389,14 +389,14 @@
let parent = 0; let parent = 0;
if (option) { if (option) {
parent = option.id; parent = option.value;
} }
let query = `?hideempty=0&order=asc&parent=${parent}&number=${this.maxNumOptionsCheckboxFinderColumns}&offset=0`; let query = `?hideempty=0&order=asc&parent=${parent}&number=${this.maxNumOptionsCheckboxFinderColumns}&offset=0`;
this.isColumnLoading = true; this.isColumnLoading = true;
axios.get(`/taxonomy/${this.taxonomy_id}/terms${query}`) axios.get(`/collection/${this.collection_id}/facets/${this.metadatum_id}${query}`)
.then(res => { .then(res => {
this.removeLevelsAfter(key); this.removeLevelsAfter(key);
this.createColumn(res, key); this.createColumn(res, key);
@ -419,7 +419,7 @@
this.isColumnLoading = true; this.isColumnLoading = true;
axios.get(`/taxonomy/${this.taxonomy_id}/terms${query}`) axios.get(`/collection/${this.collection_id}/facets/${this.metadatum_id}${query}`)
.then(res => { .then(res => {
this.appendMore(res.data, key); this.appendMore(res.data, key);
@ -450,7 +450,7 @@
for (let selected of this.selected) { for (let selected of this.selected) {
for(let i in this.finderColumns){ for(let i in this.finderColumns){
let valueIndex = this.finderColumns[i].findIndex(option => option.id == selected); let valueIndex = this.finderColumns[i].findIndex(option => option.value == selected);
if (valueIndex >= 0) { if (valueIndex >= 0) {
onlyLabels.push(this.finderColumns[i][valueIndex].name); onlyLabels.push(this.finderColumns[i][valueIndex].name);