Pedro Amorim
09dabdad95
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>
24 lines
No EOL
611 B
JavaScript
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; |