Bug 32474: Properly call getAll

To encode q parameter correctly, based on bug 33623

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2023-04-27 08:56:39 +02:00 committed by Katrin Fischer
parent 5b6761efdf
commit 409efe6cdd
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -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 => {