Bugzilla – Attachment 181037 Details for
Bug 37829
Allow additional fields for bookings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37829: Expose additional fields API client, add needed methods
Bug-37829-Expose-additional-fields-API-client-add-.patch (text/plain), 2.45 KB, created by
Paul Derscheid
on 2025-04-16 16:31:03 UTC
(
hide
)
Description:
Bug 37829: Expose additional fields API client, add needed methods
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2025-04-16 16:31:03 UTC
Size:
2.45 KB
patch
obsolete
>From 6c6db66d38e45e41ca684687285756da57f98402 Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Wed, 16 Apr 2025 15:34:39 +0000 >Subject: [PATCH] Bug 37829: Expose additional fields API client, add needed > methods > >--- > .../intranet-tmpl/prog/js/fetch/api-client.js | 2 ++ > .../prog/js/fetch/http-client.js | 22 +++++++++++++++++++ > 2 files changed, 24 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js b/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js >index 2d623b6f9b..87ed378908 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/fetch/api-client.js >@@ -1,5 +1,6 @@ > import HttpClient from "./http-client.js"; > >+import AdditionalFieldsAPIClient from "./additional-fields-api-client.js"; > import ArticleRequestAPIClient from "./article-request-api-client.js"; > import AVAPIClient from "./authorised-values-api-client.js"; > import CataloguingAPIClient from "./cataloguing-api-client.js"; >@@ -14,6 +15,7 @@ import SysprefAPIClient from "./system-preferences-api-client.js"; > import TicketAPIClient from "./ticket-api-client.js"; > > export const APIClient = { >+ additional_fields: new AdditionalFieldsAPIClient(HttpClient), > article_request: new ArticleRequestAPIClient(HttpClient), > authorised_values: new AVAPIClient(HttpClient), > cataloguing: new CataloguingAPIClient(HttpClient), >diff --git a/koha-tmpl/intranet-tmpl/prog/js/fetch/http-client.js b/koha-tmpl/intranet-tmpl/prog/js/fetch/http-client.js >index 50dc09f6ca..9c886801f0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/fetch/http-client.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/fetch/http-client.js >@@ -79,6 +79,28 @@ class HttpClient { > return res; > } > >+ get(params = {}) { >+ return this._fetchJSON(params.endpoint, params.headers, { >+ ...params.options, >+ method: "GET", >+ }); >+ } >+ >+ getAll(params = {}) { >+ let url = >+ params.endpoint + >+ "?" + >+ new URLSearchParams({ >+ _per_page: -1, >+ ...(params.params && params.params), >+ ...(params.query && { q: JSON.stringify(params.query) }), >+ }); >+ return this._fetchJSON(url, params.headers, { >+ ...params.options, >+ method: "GET", >+ }); >+ } >+ > post(params = {}) { > const body = params.body > ? typeof params.body === "string" >-- >2.39.5
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 37829
:
181034
|
181035
|
181036
| 181037 |
181038
|
181039
|
181040
|
181041
|
181042
|
181043