@@ -, +, @@ --- Koha/REST/Plugin/Objects.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) --- a/Koha/REST/Plugin/Objects.pm +++ a/Koha/REST/Plugin/Objects.pm @@ -44,6 +44,18 @@ for API rendering. sub register { my ( $self, $app ) = @_; + $app->helper( + 'objects.find' => sub { + my ( $c, $result_set, $id ) = @_; + + # Look for embeds + my $embed = $c->stash('koha.embed'); + my $object = $result_set->find( $id ); + + return $object->to_api({ embed => $embed, av_expand => $c->req->headers->header('x-koha-av') }); + } + ); + $app->helper( 'objects.search' => sub { my ( $c, $result_set ) = @_; --