From 409efe6cdda30792bffa7d5a8fe52da7359093f9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 27 Apr 2023 08:56:39 +0200 Subject: [PATCH] Bug 32474: Properly call getAll To encode q parameter correctly, based on bug 33623 Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer --- .../vue/components/InfiniteScrollSelect.vue | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/InfiniteScrollSelect.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/InfiniteScrollSelect.vue index 83bd76cce5..f44b8d29af 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/InfiniteScrollSelect.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/InfiniteScrollSelect.vue @@ -90,7 +90,14 @@ export default { async fetchInitialData(dataType) { const client = APIClient.erm await client[dataType] - .getAll("_page=1&_per_page=20&_match=contains") + .getAll( + {}, + { + _page: 1, + _per_page: 20, + _match: "contains", + } + ) .then( items => { this.data = items @@ -107,10 +114,13 @@ export default { this.data = [] this.search = e const client = APIClient.erm + const attribute = "me." + this.queryProperty + const q = {} + q[attribute] = { like: `%${e}%` } await client[this.dataType] - .getAll( - `q={"me.${this.queryProperty}":{"like":"%${e}%"}}&_per_page=-1` - ) + .getAll(q, { + _per_page: -1, + }) .then( items => { this.data = items @@ -143,7 +153,12 @@ export default { const client = APIClient.erm await client[this.dataType] .getAll( - `_page=${this.scrollPage}&_per_page=20&_match=contains` + {}, + { + _page: this.scrollPage, + _per_page: 20, + _match: "contains", + } ) .then( items => {