@@ -, +, @@ unnecessary checks --- Koha/REST/V1/Biblios.pm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) --- a/Koha/REST/V1/Biblios.pm +++ a/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 { --