Koha/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/authorised-values.js
Pedro Amorim 09dabdad95
Bug 32983: Use REST API route to retrieve authorised values
Make one API call for all AV categories+values instead of one API call per AV category required

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-03-02 14:46:14 -03:00

24 lines
No EOL
611 B
JavaScript

import HttpClient from "./http-client";
export class AVAPIClient extends HttpClient {
constructor() {
super({
baseURL: "/api/v1/authorised_value_categories",
});
}
get values() {
return {
getCategoriesWithValues: (cat_array) =>
this.get({
endpoint: "?q={\"me.category_name\":["+(cat_array.join(", "))+"]}",
headers: {
"x-koha-embed":
"authorised_values",
},
}),
};
}
}
export default AVAPIClient;