Bugzilla – Attachment 153097 Details for
Bug 34219
getAll not allowing additional parameters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34219: Allow getAll to receive additional URL parameters
Bug-34219-Allow-getAll-to-receive-additional-URL-p.patch (text/plain), 4.05 KB, created by
Jonathan Druart
on 2023-07-06 14:14:36 UTC
(
hide
)
Description:
Bug 34219: Allow getAll to receive additional URL parameters
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-07-06 14:14:36 UTC
Size:
4.05 KB
patch
obsolete
>From 1460ff507d0d0c0fc61ded3016e4229cde249441 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 6 Jul 2023 16:13:22 +0200 >Subject: [PATCH] Bug 34219: Allow getAll to receive additional URL parameters > >It's not possible to pass additional URL parameters. We need it at least for bug 32474. >--- > .../prog/js/vue/fetch/acquisition-api-client.js | 6 ++++-- > .../prog/js/vue/fetch/erm-api-client.js | 15 +++++++++------ > .../prog/js/vue/fetch/http-client.js | 1 + > 3 files changed, 14 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/acquisition-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/acquisition-api-client.js >index 4a4553506ef..d3f4e5ddd21 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/acquisition-api-client.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/acquisition-api-client.js >@@ -9,9 +9,11 @@ export class AcquisitionAPIClient extends HttpClient { > > get vendors() { > return { >- getAll: query => >+ getAll: (query, params) => > this.get({ >- endpoint: "vendors?" + (query || "_per_page=-1"), >+ endpoint: "vendors", >+ query, >+ params, > headers: { > "x-koha-embed": "aliases", > }, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/erm-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/erm-api-client.js >index f9be2c5aa07..e298f7f8fbd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/erm-api-client.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/erm-api-client.js >@@ -17,10 +17,11 @@ export class ERMAPIClient extends HttpClient { > "periods,user_roles,user_roles.patron,agreement_licenses,agreement_licenses.license,agreement_relationships,agreement_relationships.related_agreement,documents,agreement_packages,agreement_packages.package,vendor", > }, > }), >- getAll: query => >+ getAll: (query, params) => > this.getAll({ > endpoint: "agreements", >- query: query, >+ query, >+ params, > }), > delete: id => > this.delete({ >@@ -59,10 +60,11 @@ export class ERMAPIClient extends HttpClient { > "user_roles,user_roles.patron,vendor,documents", > }, > }), >- getAll: query => >+ getAll: (query, params) => > this.getAll({ > endpoint: "licenses", >- query: query, >+ query, >+ params, > headers: { > "x-koha-embed": "vendor", > }, >@@ -104,10 +106,11 @@ export class ERMAPIClient extends HttpClient { > "package_agreements,package_agreements.agreement,resources+count,vendor", > }, > }), >- getAll: query => >+ getAll: (query, params) => > this.getAll({ > endpoint: "eholdings/local/packages", >- query: query, >+ query, >+ params, > headers: { > "x-koha-embed": "resources+count,vendor.name", > }, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/http-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/http-client.js >index 936231c3f60..8d880d258ef 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/http-client.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/http-client.js >@@ -57,6 +57,7 @@ class HttpClient { > "?" + > new URLSearchParams({ > _per_page: -1, >+ ...(params.params && params.params), > ...(params.query && { q: JSON.stringify(params.query) }), > }); > return this._fetchJSON(url, params.headers, { >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34219
:
153097
|
153631
|
154517