Bug 29877: Make POST /holds handle maxreserves correctly
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 13 Jan 2022 15:10:30 +0000 (12:10 -0300)
committerKyle Hall <kyle@bywatersolutions.com>
Fri, 4 Mar 2022 14:32:38 +0000 (09:32 -0500)
commitb002a84a2c6e5ee59562620b62bb21cfc7f61a02
treeb122e0c06f9467afd8e9b478a3724f488bd5e9cb
parent8ea1b883b76187a1d863f08426b65f5321fd703e
Bug 29877: Make POST /holds handle maxreserves correctly

The current implementation doesn't consider the following values for the
syspref: undef and 0.

The tests mistakenly didn't cover them.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: Tests fail, obvious warnings about comparing undefined values
         too.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. You can try on Postman as well
=> SUCCESS: Behavior is correct!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/REST/V1/Holds.pm