Bug 15524: (RM follow-up) Fix calls and add filter
[koha.git] / Koha / REST / V1 / Hold.pm
index 2833f39..c3cb926 100644 (file)
@@ -89,9 +89,9 @@ sub add {
       ? CanItemBeReserved( $borrowernumber, $itemnumber )
       : CanBookBeReserved( $borrowernumber, $biblionumber );
 
-    unless ($can_reserve eq 'OK') {
+    unless ($can_reserve->{status} eq 'OK') {
         return $c->render( status => 403, openapi => {
-            error => "Reserve cannot be placed. Reason: $can_reserve"
+            error => "Reserve cannot be placed. Reason: ". $can_reserve->{status}
         } );
     }