Bug 32801: Prevent 500 on /checkouts
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 5 Jul 2023 10:26:09 +0000 (12:26 +0200)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Tue, 18 Jul 2023 14:14:43 +0000 (14:14 +0000)
commitf23ca87c3df7a3a34f2a5a504514a840ba1e12b5
tree0ba6c5acd6ac5297db7d2ddd7dffebf351b581dd
parent4fae89c4c22f55cbfd3b627dee1137a60751256f
Bug 32801: Prevent 500 on /checkouts

If checked_in flag is passed we return the "old checkouts". But if the
item has been deleted we explode with
  "message":"Expected integer - got null.","path":"\/0\/item_id"

The specs should reflect that an item can have been deleted.

Test plan:
Hit the endpoint and confirm the above.
Can be done easily using curl:
  curl -u koha:koha --request GET 'http://localhost:8081/api/v1/checkouts?patron_id=5&checked_in=1' --header "Content-Type: application/json" | jq

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c4cb183ae1f7225c86a38178176c966ad9cebeda)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ac1febd685936a168f853741be45fd58a445c1c3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
api/v1/swagger/definitions/checkout.yaml