Jonathan Druart
3c6dd02acb
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
33 lines
913 B
JavaScript
33 lines
913 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&csrf_token=%s".format(
|
|
variable,
|
|
value,
|
|
csrf_token
|
|
),
|
|
headers: {
|
|
"Content-Type":
|
|
"application/x-www-form-urlencoded;charset=utf-8",
|
|
},
|
|
}),
|
|
};
|
|
}
|
|
}
|
|
|
|
export default SysprefAPIClient;
|