Bug 25662: Make the route for holds restpect maxreserves
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 23 Jun 2020 13:33:14 +0000 (10:33 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 25 Aug 2020 13:07:27 +0000 (15:07 +0200)
commit69bdc94cd4f420094c5706fb2bfc472ba24a5054
tree6f519519ac9e114b1637eaf44f2e59e5da1c73dc
parent9a63cf6dec55c67491e5a2807fe74f9083167ccc
Bug 25662: Make the route for holds restpect maxreserves

This patch fixes the behaviour for the POST /holds route. It assumed
maxreserves was checked in CanItemBeReserved which is not the case.

Tests are added to check for this behaviour.

To test:
1. Apply the regression tests
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/REST/V1/Holds.pm