From bf61efbf78c2bd15dd78051abec59f94c16e9f36 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 29 Oct 2024 16:52:34 +0000 Subject: [PATCH] Bug 38290: Add library group api client (cherry picked from commit 67277c0bc4da4ac3bafd436c77b49bc7884e3f5b) --- .../prog/js/vue/fetch/api-client.js | 2 ++ .../prog/js/vue/fetch/library-api-client.js | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 koha-tmpl/intranet-tmpl/prog/js/vue/fetch/library-api-client.js diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js index 7e10da71eae..b37987f28f8 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/api-client.js @@ -7,6 +7,7 @@ import ItemAPIClient from "./item-api-client"; import RecordSourcesAPIClient from "./record-sources-api-client"; import SysprefAPIClient from "./system-preferences-api-client"; import PreservationAPIClient from "./preservation-api-client"; +import LibraryAPIClient from "./library-api-client"; export const APIClient = { erm: new ERMAPIClient(), @@ -18,4 +19,5 @@ export const APIClient = { sysprefs: new SysprefAPIClient(), preservation: new PreservationAPIClient(), record_sources: new RecordSourcesAPIClient(), + libraries: new LibraryAPIClient(), }; diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/library-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/library-api-client.js new file mode 100644 index 00000000000..46906dd1493 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/fetch/library-api-client.js @@ -0,0 +1,22 @@ +import HttpClient from "./http-client"; + +export class LibraryAPIClient extends HttpClient { + constructor() { + super({ + baseURL: "/api/v1/library_groups", + }); + } + + get libraryGroups() { + return { + getAll: (query, params) => + this.getAll({ + endpoint: "", + query, + params, + }), + }; + } +} + +export default LibraryAPIClient; -- 2.39.3 (Apple Git-146)