Lines 45-50
sub register {
Link Here
|
45 |
my ( $self, $app ) = @_; |
45 |
my ( $self, $app ) = @_; |
46 |
|
46 |
|
47 |
$app->helper( |
47 |
$app->helper( |
|
|
48 |
'objects.find' => sub { |
49 |
my ( $c, $result_set, $id ) = @_; |
50 |
|
51 |
my $attributes = {}; |
52 |
|
53 |
# Look for embeds |
54 |
my $embed = $c->stash('koha.embed'); |
55 |
# Generate prefetches for embedded stuff |
56 |
$c->dbic_merge_prefetch( |
57 |
{ |
58 |
attributes => $attributes, |
59 |
result_set => $result_set |
60 |
} |
61 |
); |
62 |
|
63 |
my $object = $result_set->find( $id, $attributes ); |
64 |
|
65 |
return $object->to_api({ embed => $embed }); |
66 |
} |
67 |
); |
68 |
|
69 |
$app->helper( |
48 |
'objects.search' => sub { |
70 |
'objects.search' => sub { |
49 |
my ( $c, $result_set ) = @_; |
71 |
my ( $c, $result_set ) = @_; |
50 |
|
72 |
|
51 |
- |
|
|