send filters params in taxonomy components (ref. #94)
This commit is contained in:
parent
a798caca91
commit
f8bcce4589
|
@ -83,6 +83,10 @@ class REST_Facets_Controller extends REST_Controller {
|
||||||
$options = $metadatum->get_metadata_type_options();
|
$options = $metadatum->get_metadata_type_options();
|
||||||
$args = $this->prepare_filters($request);
|
$args = $this->prepare_filters($request);
|
||||||
|
|
||||||
|
if(isset($request['filter_items'])){
|
||||||
|
//TODO: HANDLE FILTERS
|
||||||
|
}
|
||||||
|
|
||||||
if( $metadatum_type === 'Tainacan\Metadata_Types\Relationship' ){
|
if( $metadatum_type === 'Tainacan\Metadata_Types\Relationship' ){
|
||||||
|
|
||||||
$restItemsClass = new REST_Items_Controller();
|
$restItemsClass = new REST_Items_Controller();
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import qs from 'qs';
|
||||||
import { tainacan as axios } from '../../../js/axios/axios';
|
import { tainacan as axios } from '../../../js/axios/axios';
|
||||||
import CheckboxFilterModal from '../../../admin/components/other/checkbox-filter-modal.vue';
|
import CheckboxFilterModal from '../../../admin/components/other/checkbox-filter-modal.vue';
|
||||||
|
|
||||||
|
@ -100,8 +101,10 @@
|
||||||
methods: {
|
methods: {
|
||||||
loadOptions(){
|
loadOptions(){
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
|
let query_items = { 'filter_items': this.query };
|
||||||
|
|
||||||
axios.get('/collection/'+ this.collection +'/facets/' + this.metadatum + `?hideempty=0&order=asc&parent=0&number=${this.filter.max_options}`)
|
axios.get('/collection/'+ this.collection +'/facets/' + this.metadatum
|
||||||
|
+ `?hideempty=0&order=asc&parent=0&number=${this.filter.max_options}&` + qs.stringify(query_items))
|
||||||
.then( res => {
|
.then( res => {
|
||||||
|
|
||||||
for (let item of res.data) {
|
for (let item of res.data) {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import qs from 'qs';
|
||||||
import { tainacan as axios } from "../../../js/axios/axios";
|
import { tainacan as axios } from "../../../js/axios/axios";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -65,8 +66,9 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
loadOptions() {
|
loadOptions() {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
|
let query_items = { 'filter_items': this.query };
|
||||||
|
|
||||||
axios.get('/collection/'+ this.collection +'/facets/' + this.metadatum + `?hideempty=0&order=asc`)
|
axios.get('/collection/'+ this.collection +'/facets/' + this.metadatum + `?hideempty=0&order=asc&` + qs.stringify(query_items))
|
||||||
.then( res => {
|
.then( res => {
|
||||||
|
|
||||||
for (let item of res.data) {
|
for (let item of res.data) {
|
||||||
|
|
|
@ -17,7 +17,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { tainacan as axios } from '../../../js/axios/axios'
|
import qs from 'qs';
|
||||||
|
import { tainacan as axios } from '../../../js/axios/axios';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
created(){
|
created(){
|
||||||
|
@ -126,10 +127,12 @@
|
||||||
search( query ){
|
search( query ){
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
this.options = [];
|
this.options = [];
|
||||||
|
|
||||||
|
let query_items = { 'filter_items': this.query };
|
||||||
|
|
||||||
let endpoint = this.isRepositoryLevel ? '/facets/' + this.metadatum : '/collection/'+ this.collection +'/facets/' + this.metadatum;
|
let endpoint = this.isRepositoryLevel ? '/facets/' + this.metadatum : '/collection/'+ this.collection +'/facets/' + this.metadatum;
|
||||||
|
|
||||||
endpoint += '?hideempty=0&order=asc';
|
endpoint += '?hideempty=0&order=asc&' + qs.stringify(query_items);
|
||||||
let valuesToIgnore = [];
|
let valuesToIgnore = [];
|
||||||
for(let val of this.selected){
|
for(let val of this.selected){
|
||||||
valuesToIgnore.push( val.value );
|
valuesToIgnore.push( val.value );
|
||||||
|
|
Loading…
Reference in New Issue