Bug 29772: Make DELETE /patrons/:patron_id return error codes
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 27 Dec 2021 14:37:59 +0000 (11:37 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 5 Jan 2022 23:33:46 +0000 (13:33 -1000)
commit82c32a1aa50a86b87d303014866d48a2a747700c
treeb4b2026e0681c0c5a2f72ef0a9d00f6eed38e2a3
parentb3fe6a4ba399b92d061dfb92446d9d259915ccf9
Bug 29772: Make DELETE /patrons/:patron_id return error codes

This patch makes the controller add the error_code attribute on error
conditions payload.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/patrons.t
=> FAIL: Boo, the API doesn't include the error_code attribute on the
error responses for the DELETE /patrons/:patron_id route
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! error_code is included in the response!
5. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/REST/V1/Patrons.pm