Koha/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js
Pedro Amorim 3296cf37f4
Bug 33408: Fix template literal
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-04-13 11:48:06 -03:00

29 lines
795 B
JavaScript

import HttpClient from "./http-client";
export class SysprefAPIClient extends HttpClient {
constructor() {
super({
baseURL: "/cgi-bin/koha/svc/config/systempreferences",
});
}
get sysprefs() {
return {
get: (variable) =>
this.get({
endpoint: "/?pref=" + variable,
}),
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;