Bugzilla – Attachment 126618 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.59 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-10-20 21:13:44 UTC
(
hide
)
Description:
Bug 29290: Add GET /biblios/:biblio_id/checkouts
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-10-20 21:13:44 UTC
Size:
1.59 KB
patch
obsolete
>From e3b2d9bfc52e565a6b855b038021c43621bdd91e 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> >--- > Koha/REST/V1/Biblios.pm | 37 +++++++++++++++++++++++++++++++++++++ > 1 file changed, 37 insertions(+) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index 3ddb896e73..27d50aa10e 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -269,6 +269,43 @@ 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 $checkouts_set; >+ 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.32.0
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