Lines 44-49
for API rendering.
Link Here
|
44 |
sub register { |
44 |
sub register { |
45 |
my ( $self, $app ) = @_; |
45 |
my ( $self, $app ) = @_; |
46 |
|
46 |
|
|
|
47 |
$app->helper( |
48 |
'objects.find' => sub { |
49 |
my ( $c, $result_set, $id ) = @_; |
50 |
|
51 |
# Look for embeds |
52 |
my $embed = $c->stash('koha.embed'); |
53 |
my $object = $result_set->find( $id ); |
54 |
|
55 |
return $object->to_api({ embed => $embed, av_expand => $c->req->headers->header('x-koha-av') }); |
56 |
} |
57 |
); |
58 |
|
47 |
$app->helper( |
59 |
$app->helper( |
48 |
'objects.search' => sub { |
60 |
'objects.search' => sub { |
49 |
my ( $c, $result_set ) = @_; |
61 |
my ( $c, $result_set ) = @_; |
50 |
- |
|
|