From bfb8c9aa6808230aa9c5383a65d7e3a7c814fba9 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 13 Aug 2024 14:18:08 +0000 Subject: [PATCH] Bug 10190: Add itemtypes and patron categories to the item/patron api clients This patch adds patron and itemtype api clients for the Vue ecosystem Sponsored-by: Glasgow Colleges Library Group --- .../prog/js/vue/fetch/item-api-client.js | 11 +++++++++++ .../prog/js/vue/fetch/patron-api-client.js | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/item-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/item-api-client.js index 0b32db44399..ada999a1a5e 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/item-api-client.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/item-api-client.js @@ -18,6 +18,17 @@ export class ItemAPIClient extends HttpClient { }), }; } + get itemTypes() { + return { + getAll: (query, params, headers) => + this.getAll({ + endpoint: "item_types", + query, + params, + headers, + }), + }; + } } export default ItemAPIClient; diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/patron-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/patron-api-client.js index 4c39e977fda..e9a9a0f28f4 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/patron-api-client.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/patron-api-client.js @@ -15,6 +15,17 @@ export class PatronAPIClient extends HttpClient { }), }; } + get patronCategories() { + return { + getAll: (query, params, headers) => + this.getAll({ + endpoint: "patron_categories", + query, + params, + headers, + }), + }; + } } export default PatronAPIClient; -- 2.47.0