Bugzilla – Attachment 154517 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.17 KB, created by
Martin Renvoize (ashimema)
on 2023-08-17 10:28:36 UTC
(
hide
)
Description:
Bug 34219: Allow getAll to receive additional URL parameters
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-08-17 10:28:36 UTC
Size:
4.17 KB
patch
obsolete
>From 7827a386eebac4f109a7a16894abc94c32dcd12c 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. > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../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 4a4553506e..d3f4e5ddd2 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 0acdcac5a4..7f3679bd08 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 >@@ -26,10 +26,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({ >@@ -68,10 +69,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", > }, >@@ -113,10 +115,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 936231c3f6..8d880d258e 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.41.0
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