Bugzilla – Attachment 173016 Details for
Bug 37253
Enhance POST /checkouts endpoint to accept barcode or item_id
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37253: Tidy changes
Bug-37253-Tidy-changes.patch (text/plain), 1.90 KB, created by
Jan Kissig
on 2024-10-21 09:17:37 UTC
(
hide
)
Description:
Bug 37253: Tidy changes
Filename:
MIME Type:
Creator:
Jan Kissig
Created:
2024-10-21 09:17:37 UTC
Size:
1.90 KB
patch
obsolete
>From cf65f496418a4a2a74afcac36e2e5c9cc57c32fe Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Thu, 4 Jul 2024 15:33:46 +0000 >Subject: [PATCH] Bug 37253: Tidy changes > >Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >--- > Koha/REST/V1/Checkouts.pm | 8 ++++---- > t/db_dependent/api/v1/checkouts.t | 3 ++- > 2 files changed, 6 insertions(+), 5 deletions(-) > >diff --git a/Koha/REST/V1/Checkouts.pm b/Koha/REST/V1/Checkouts.pm >index f20e61d038..fdda8ec04f 100644 >--- a/Koha/REST/V1/Checkouts.pm >+++ b/Koha/REST/V1/Checkouts.pm >@@ -205,7 +205,7 @@ sub add { > > return try { > >- unless ($item_id or $barcode){ >+ unless ( $item_id or $barcode ) { > return $c->render( > status => 400, > openapi => { >@@ -216,11 +216,11 @@ sub add { > } > > my $item; >- if ($item_id){ >+ if ($item_id) { > $item = Koha::Items->find($item_id); > } >- if ($barcode){ >- $item = Koha::Items->find({ barcode => $barcode }); >+ if ($barcode) { >+ $item = Koha::Items->find( { barcode => $barcode } ); > } > unless ($item) { > return $c->render( >diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t >index 38d634bc4d..ec0ac749a7 100755 >--- a/t/db_dependent/api/v1/checkouts.t >+++ b/t/db_dependent/api/v1/checkouts.t >@@ -492,7 +492,8 @@ subtest 'add checkout' => sub { > $t->post_ok( "//$userid:$password@/api/v1/checkouts" => json => { item_id => $item1_id, patron_id => $patron_id } ) > ->status_is(201); > >- $t->post_ok( "//$userid:$password@/api/v1/checkouts" => json => { external_id => $item1_barcode, patron_id => $patron_id } ) >+ $t->post_ok( >+ "//$userid:$password@/api/v1/checkouts" => json => { external_id => $item1_barcode, patron_id => $patron_id } ) > ->status_is(201); > > >-- >2.39.5
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 37253
:
168503
|
168507
|
168508
|
173014
|
173015
|
173016
|
173047
|
173139
|
173140