[Koha-bugs] [Bug 23666] Add API route for additional patron attributes

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Mar 23 18:09:43 CET 2021


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

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #118510|0                           |1
        is obsolete|                            |

--- Comment #18 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 118701
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=118701&action=edit
Bug 23666: Add extended attributes routes

This patch adds routes to handle patron's extended attributes:

GET    /patrons/:patron_id/extended_attributes
POST   /patrons/:patron_id/extended_attributes
PUT    /patrons/:patron_id/extended_attributes <- to overwrite them all
DELETE /patrons/:patron_id/extended_attributes/:extended_attribute_id

Controllers rely on the Koha::Patron methods for retrieving/adding
extended attributes. Exceptions are correctly catch and handled in the
responses. This is all covered by tests as well.

Note: I decidedto override the default sorting on the PUT response,
    because the overloaded search sorting it felt a bit wrong on the API.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons_extended_attributes.t
=> SUCCESS: Tests pass!
3. Play with your favourite tool and this routes
=> SUCCESS: They work well!
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list