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

--- Comment #77 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 211236
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211236&action=edit
Bug 38291: (QA follow-up) Map attributes to API naming conventions

The endpoint returned the raw database column names. Add
Koha::Library::Group->to_api_mapping and rename the attributes in the
swagger definition and query parameters to follow the API naming
conventions:

    id                     => library_group_id
    branchcode             => library_id
    ft_hide_patron_info    => hide_patron_info
    ft_limit_item_editing  => limit_item_editing
    ft_search_groups_opac  => is_opac_search_group
    ft_search_groups_staff => is_staff_search_group
    ft_local_hold_group    => is_local_hold_group
    ft_local_float_group   => is_local_float_group

The descriptions of the attributes now explain what each one does,
instead of repeating the column name. parent_id keeps its name, as it
identifies the parent library group.

To test:
1. Apply the patches, then run yarn api:bundle and restart_all
2. Administration > Library groups: create a group "Searchable" with
   "Use for OPAC search groups" checked and add a library to it
3. Log in to the staff interface as a superlibrarian and visit
   /api/v1/library_groups
=> SUCCESS: the entries use library_group_id, library_id,
   hide_patron_info, limit_item_editing, is_opac_search_group,
   is_staff_search_group, is_local_hold_group and
   is_local_float_group
=> SUCCESS: "Searchable" has is_opac_search_group true
4. Visit /api/v1/library_groups?q={"is_opac_search_group":true}
=> SUCCESS: only the groups used for OPAC search are listed
5. Visit /api/v1/library_groups?q={"library_id":"<branchcode of the
   library you added>"}
=> SUCCESS: only the entry for that library in the group is listed
6. Run: prove t/db_dependent/api/v1/library_groups.t xt/api.t
=> SUCCESS: Tests pass

Signed-off-by: Jacob O'Mara <[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