|
Lines 269-274
sub get_items {
Link Here
|
| 269 |
}; |
269 |
}; |
| 270 |
} |
270 |
} |
| 271 |
|
271 |
|
|
|
272 |
=head3 get_checkouts |
| 273 |
|
| 274 |
List Koha::Checkout objects |
| 275 |
|
| 276 |
=cut |
| 277 |
|
| 278 |
sub get_checkouts { |
| 279 |
my $c = shift->openapi->valid_input or return; |
| 280 |
|
| 281 |
my $checked_in = delete $c->validation->output->{checked_in}; |
| 282 |
|
| 283 |
try { |
| 284 |
my $checkouts_set; |
| 285 |
my $biblio = Koha::Biblios->find( $c->validation->param('biblio_id') ); |
| 286 |
|
| 287 |
unless ($biblio) { |
| 288 |
return $c->render( |
| 289 |
status => 404, |
| 290 |
openapi => { error => 'Object not found' } |
| 291 |
); |
| 292 |
} |
| 293 |
|
| 294 |
my $checkouts = |
| 295 |
($checked_in) |
| 296 |
? $c->objects->search( scalar $biblio->old_checkouts ) |
| 297 |
: $c->objects->search( scalar $biblio->current_checkouts ); |
| 298 |
|
| 299 |
return $c->render( |
| 300 |
status => 200, |
| 301 |
openapi => $checkouts |
| 302 |
); |
| 303 |
} |
| 304 |
catch { |
| 305 |
$c->unhandled_exception($_); |
| 306 |
}; |
| 307 |
} |
| 308 |
|
| 272 |
=head3 pickup_locations |
309 |
=head3 pickup_locations |
| 273 |
|
310 |
|
| 274 |
Method that returns the possible pickup_locations for a given biblio |
311 |
Method that returns the possible pickup_locations for a given biblio |
| 275 |
- |
|
|