Koha/koha-tmpl/intranet-tmpl/prog/js/fetch/article-request-api-client.js
Jonathan Druart 37a16e69c7
Bug 36374: Keep tidy files from 'fetch' directory
And tidy them

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-29 15:19:33 +02:00

54 lines
1.6 KiB
JavaScript

/* keep tidy */
import HttpClient from "./http-client.js";
export class ArticleRequestAPIClient extends HttpClient {
constructor() {
super({
baseURL: "/cgi-bin/koha/svc/article_request",
headers: {
"Content-Type":
"application/x-www-form-urlencoded;charset=utf-8",
},
});
}
get articleRequests() {
return {
process: id =>
this.post({
endpoint: "",
body: "id=%s&op=%s".format(id, "cud-process"),
}),
complete: id =>
this.post({
endpoint: "",
body: "id=%s&op=%s".format(id, "cud-complete"),
}),
pending: id =>
this.post({
endpoint: "",
body: "id=%s&op=%s".format(id, "cud-pending"),
}),
update_urls: (id, urls) =>
this.post({
endpoint: "",
body: "id=%s&urls=%s&op=%s".format(
id,
urls,
"cud-update_urls"
),
}),
update_library_id: (id, library_id) =>
this.post({
endpoint: "",
body: "id=%s&library_id=%s&op=%s".format(
id,
library_id,
"cud-update_library_id"
),
}),
};
}
}
export default ArticleRequestAPIClient;