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;