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();
|
||||
$args = $this->prepare_filters($request);
|
||||
|
||||
if(isset($request['filter_items'])){
|
||||
//TODO: HANDLE FILTERS
|
||||
}
|
||||
|
||||
if( $metadatum_type === 'Tainacan\Metadata_Types\Relationship' ){
|
||||
|
||||
$restItemsClass = new REST_Items_Controller();
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import qs from 'qs';
|
||||
import { tainacan as axios } from '../../../js/axios/axios';
|
||||
import CheckboxFilterModal from '../../../admin/components/other/checkbox-filter-modal.vue';
|
||||
|
||||
|
@ -100,8 +101,10 @@
|
|||
methods: {
|
||||
loadOptions(){
|
||||
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 => {
|
||||
|
||||
for (let item of res.data) {
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import qs from 'qs';
|
||||
import { tainacan as axios } from "../../../js/axios/axios";
|
||||
|
||||
export default {
|
||||
|
@ -65,8 +66,9 @@ export default {
|
|||
methods: {
|
||||
loadOptions() {
|
||||
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 => {
|
||||
|
||||
for (let item of res.data) {
|
||||
|
|
|
@ -17,7 +17,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { tainacan as axios } from '../../../js/axios/axios'
|
||||
import qs from 'qs';
|
||||
import { tainacan as axios } from '../../../js/axios/axios';
|
||||
|
||||
export default {
|
||||
created(){
|
||||
|
@ -127,9 +128,11 @@
|
|||
this.isLoading = true;
|
||||
this.options = [];
|
||||
|
||||
let query_items = { 'filter_items': this.query };
|
||||
|
||||
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 = [];
|
||||
for(let val of this.selected){
|
||||
valuesToIgnore.push( val.value );
|
||||
|
|
Loading…
Reference in New Issue