Bugzilla – Attachment 148596 Details for
Bug 33289
Vue - Add API client class to interact with svc/config/systempreferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33289: Add API client class to interact with svc/config/systempreferences
Bug-33289-Add-API-client-class-to-interact-with-sv.patch (text/plain), 2.75 KB, created by
Pedro Amorim
on 2023-03-23 10:12:23 UTC
(
hide
)
Description:
Bug 33289: Add API client class to interact with svc/config/systempreferences
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-03-23 10:12:23 UTC
Size:
2.75 KB
patch
obsolete
>From 217e3a0b3564e06ce527ab1579615df962cd6041 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 21 Mar 2023 09:00:10 +0100 >Subject: [PATCH] Bug 33289: Add API client class to interact with > svc/config/systempreferences > >On bug 30708 we will need to modify sysprefs from the UI (Vue app), it >could be useful for other developments as well and so it is moved on its >own bug report. > >Test plan: >It can be tested independently of bug 30708 using the following code: > >const client = APIClient.sysprefs >client.sysprefs > .update( > "CardnumberLength", > "42" > ) > >Sponsored-by: BULAC - http://www.bulac.fr/ >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > .../prog/js/vue/fetch/api-client.js | 2 ++ > .../fetch/system-preferences-api-client.js | 25 +++++++++++++++++++ > 2 files changed, 27 insertions(+) > create mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js >index 5c3f8535e2..2c17ef443f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js >@@ -2,10 +2,12 @@ import ERMAPIClient from "./erm-api-client"; > import PatronAPIClient from "./patron-api-client"; > import AcquisitionAPIClient from "./acquisition-api-client"; > import AVAPIClient from "./authorised-values"; >+import SysprefAPIClient from "./system-preferences-api-client"; > > export const APIClient = { > erm: new ERMAPIClient(), > patron: new PatronAPIClient(), > acquisition: new AcquisitionAPIClient(), > authorised_values: new AVAPIClient(), >+ sysprefs: new SysprefAPIClient(), > }; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js >new file mode 100644 >index 0000000000..1e4cd3f7a7 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js >@@ -0,0 +1,25 @@ >+import HttpClient from "./http-client"; >+ >+export class SysprefAPIClient extends HttpClient { >+ constructor() { >+ super({ >+ baseURL: "/cgi-bin/koha/svc/config/systempreferences", >+ }); >+ } >+ >+ get sysprefs() { >+ return { >+ update: (variable, value) => >+ this.post({ >+ endpoint: "", >+ body: "pref_%s=%s".format(variable, value), >+ headers: { >+ "Content-Type": >+ "application/x-www-form-urlencoded;charset=utf-8", >+ }, >+ }), >+ }; >+ } >+} >+ >+export default SysprefAPIClient; >-- >2.30.2
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 33289
:
148442
|
148596
|
149525
|
149526