Bugzilla – Attachment 126959 Details for
Bug 29290
Add routes to fetch checkouts for a given biblio
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29290: Add GET /biblios/:biblio_id/checkouts
Bug-29290-Add-GET-bibliosbiblioidcheckouts.patch (text/plain), 1.68 KB, created by
Martin Renvoize (ashimema)
on 2021-10-27 08:38:00 UTC
(
hide
)
Description:
Bug 29290: Add GET /biblios/:biblio_id/checkouts
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-10-27 08:38:00 UTC
Size:
1.68 KB
patch
obsolete
>From 1c157e07a39188e238c9305130ec872f8ccd5600 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 20 Oct 2021 18:12:41 -0300 >Subject: [PATCH] Bug 29290: Add GET /biblios/:biblio_id/checkouts > >This patch adds the required controller method. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/REST/V1/Biblios.pm | 36 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 36 insertions(+) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index 3ddb896e73..fbc9790bc5 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -269,6 +269,42 @@ sub get_items { > }; > } > >+=head3 get_checkouts >+ >+List Koha::Checkout objects >+ >+=cut >+ >+sub get_checkouts { >+ my $c = shift->openapi->valid_input or return; >+ >+ my $checked_in = delete $c->validation->output->{checked_in}; >+ >+ try { >+ my $biblio = Koha::Biblios->find( $c->validation->param('biblio_id') ); >+ >+ unless ($biblio) { >+ return $c->render( >+ status => 404, >+ openapi => { error => 'Object not found' } >+ ); >+ } >+ >+ my $checkouts = >+ ($checked_in) >+ ? $c->objects->search( scalar $biblio->old_checkouts ) >+ : $c->objects->search( scalar $biblio->current_checkouts ); >+ >+ return $c->render( >+ status => 200, >+ openapi => $checkouts >+ ); >+ } >+ catch { >+ $c->unhandled_exception($_); >+ }; >+} >+ > =head3 pickup_locations > > Method that returns the possible pickup_locations for a given biblio >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29290
:
126617
|
126618
|
126622
|
126625
|
126637
|
126638
|
126639
|
126957
|
126958
| 126959 |
126980
|
126982