Jonathan Druart
37a16e69c7
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>
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
/* keep tidy */
|
|
import HttpClient from "./http-client.js";
|
|
|
|
export class CataloguingAPIClient extends HttpClient {
|
|
constructor() {
|
|
super({
|
|
baseURL: "/cgi-bin/koha/svc/",
|
|
});
|
|
}
|
|
|
|
get catalog_bib() {
|
|
return {
|
|
create: bib_info =>
|
|
this.post({
|
|
endpoint: "new_bib/frameworkcode=%s".format(
|
|
bib_info.frameworkcode
|
|
),
|
|
body: bib_info.record.toXML(),
|
|
headers: {
|
|
"Content-Type": "text/xml",
|
|
},
|
|
}),
|
|
update: bib_info =>
|
|
this.post({
|
|
endpoint: "bib/%s?frameworkcode=%s".format(
|
|
bib_info.id,
|
|
bib_info.frameworkcode
|
|
),
|
|
body: bib_info.record.toXML(),
|
|
headers: {
|
|
"Content-Type": "text/xml",
|
|
},
|
|
}),
|
|
};
|
|
}
|
|
}
|
|
|
|
export default CataloguingAPIClient;
|