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:
parent
5b6761efdf
commit
409efe6cdd
1 changed files with 20 additions and 5 deletions
|
@ -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 => {
|
||||
|
|
Loading…
Reference in a new issue