From 0add85d662d9cd7ba3860b62b140b612fa96121a Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 17 Aug 2021 15:44:45 -0300 Subject: [PATCH] Bug 24857: Use $c->objects->find Signed-off-by: Tomas Cohen Arazi --- Koha/REST/V1/Biblios/Volumes.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Koha/REST/V1/Biblios/Volumes.pm b/Koha/REST/V1/Biblios/Volumes.pm index 792f511f48..dedf26bdf4 100644 --- a/Koha/REST/V1/Biblios/Volumes.pm +++ b/Koha/REST/V1/Biblios/Volumes.pm @@ -69,13 +69,12 @@ sub get { my $volume_id = $c->validation->param('volume_id'); my $biblio_id = $c->validation->param('biblio_id'); - my $volume = Koha::Biblio::Volumes->find( $volume_id ); - my $embed = $c->stash('koha.embed'); + my $volume = $c->objects->find( Koha::Biblio::Volumes->new, $volume_id ); - if ( $volume && $volume->biblionumber eq $biblio_id ) { + if ( $volume && $volume->{biblio_id} eq $biblio_id ) { return $c->render( status => 200, - openapi => $volume->to_api({ embed => $embed }) + openapi => $volume ); } else { -- 2.30.2