Koha/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js
Jonathan Druart 4ffe9a6ed9
Bug 34055: Add API client class to get items
This patch add a new item-api-client.js API client to fetch items using
our /items REST API endpoint.

Test plan:
Add the following two lines to one of the existing Vue component (in
data() for instance) and hit the view that is using it.
  let client = APIClient.item
  client.items.getAll().then((items) => console.log(items))
Notice that you see all the items in the console.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Was failing the pretty test, fixed with yarn pretty
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-09-22 10:52:47 -03:00

15 lines
577 B
JavaScript

import ERMAPIClient from "./erm-api-client";
import PatronAPIClient from "./patron-api-client";
import AcquisitionAPIClient from "./acquisition-api-client";
import AVAPIClient from "./authorised-values-api-client";
import ItemAPIClient from "./item-api-client";
import SysprefAPIClient from "./system-preferences-api-client";
export const APIClient = {
erm: new ERMAPIClient(),
patron: new PatronAPIClient(),
acquisition: new AcquisitionAPIClient(),
authorised_values: new AVAPIClient(),
item: new ItemAPIClient(),
sysprefs: new SysprefAPIClient(),
};