From 1548e34af61c47ce3381dfee3503ae0e5de25201 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 4 Jul 2024 15:33:46 +0000 Subject: [PATCH] Bug 37253: Tidy changes Signed-off-by: Matt Blenkinsop --- 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 aa427c9974..8e1dba4163 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.3 (Apple Git-146)