From 2ab712d163a8e9721d22e2180032e3160f856ccc Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Tue, 3 Jan 2023 12:12:39 -0300 Subject: [PATCH] Bug 31798: (follow-up) Tidy up camel cased variables and unnecessary checks --- Koha/REST/V1/Biblios.pm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm index 2cc70b7151..2a36f2487c 100644 --- a/Koha/REST/V1/Biblios.pm +++ b/Koha/REST/V1/Biblios.pm @@ -310,21 +310,12 @@ sub add_item { $item->barcode($barcode); } - if ( defined $item->barcode - && Koha::Items->search( { barcode => $item->barcode } )->count ) - { - return $c->render( - status => 400, - openapi => { error => "Barcode not unique" } - ); - } - - my $storedItem = $item->store; - $storedItem->discard_changes; + my $stored_item = $item->store; + $stored_item->discard_changes; $c->render( status => 201, - openapi => $storedItem->to_api + openapi => $stored_item->to_api ); } catch { -- 2.25.1