]> git.koha-community.org Git - koha.git/commit
Bug 23666: Add PATCH /patron/:patron_id/extended_attributes/:extended_attribute_id
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 25 Mar 2021 13:25:41 +0000 (10:25 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 22 Apr 2021 12:50:11 +0000 (14:50 +0200)
commit4d011bd9983926488f783730ca43e98e6e07dabe
tree08365b7b5542405b24c10faf334d7b5dfbb92837
parent12b6d1f79201f7d0702199afb841dc3ed24ff94b
Bug 23666: Add PATCH /patron/:patron_id/extended_attributes/:extended_attribute_id

This patch adds the described route. It is designed to use the
underlying libraries' methods to update an existing attribute.

The tests cover the use cases.

Note: I added handling for two exceptions that can only occur on bad
data (i.e. not by using our codebase). This are:
- Koha::Exceptions::Patron::Attribute::InvalidType
- Koha::Exceptions::Patron::Attribute::NonRepeatable

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons_extended_attributes.t
=> SUCCESS: Tests pass!
3. PLay with the route
=> SUCCESS: Expected behavior!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/REST/V1/Patrons/Attributes.pm
api/v1/swagger/paths/patrons_extended_attributes.json
t/db_dependent/api/v1/patrons_extended_attributes.t