https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38291

--- Comment #66 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 211207
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211207&action=edit
Bug 38291: Add an endpoint to list library groups

Library groups are configured in Administration > Library groups, but
they cannot be read through the REST API. Add

    GET /api/v1/library_groups

which lists the library groups with the usual paging, sorting and q
searching. The library_groups table holds both the groups and the
libraries that belong to them, so the list contains an entry for each
group and an entry for each library added to a group. Groups carry a
title, a description, an optional parent group and the feature flags
set in the administration page (hide patron info, limit item editing,
search groups, local hold and float groups).

Reading the list requires the catalogue permission.

The route is implemented by the new Koha::REST::V1::LibraryGroups
controller, with its swagger path and definition.

To test:
1. Apply the patches, then run yarn build and restart_all
2. Administration > Library groups: create a group "Consortium", then
   add two sub groups to it, "Region 1" and "Region 2". Use "Add
   library" to add a library to "Region 1"
3. Log in to the staff interface as a superlibrarian and, in the same
   browser, visit /api/v1/library_groups
=> SUCCESS: a JSON list with an entry for each group, and one for the
   library you added, showing the title and description of the groups
4. Visit /api/v1/library_groups?title=Region%201
=> SUCCESS: only the "Region 1" group is listed
5. Visit /api/v1/library_groups?_per_page=1&_page=2
=> SUCCESS: a single entry is listed, the second one

Signed-off-by: Brendan Gallagher <[email protected]>
Signed-off-by: Lucas Gass <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to