|
Lines 114-120
shouldn't be called twice in it.
Link Here
|
| 114 |
'objects.search' => sub { |
114 |
'objects.search' => sub { |
| 115 |
my ( $c, $result_set ) = @_; |
115 |
my ( $c, $result_set ) = @_; |
| 116 |
|
116 |
|
| 117 |
return $c->objects->to_api( $c->objects->search_rs($result_set) ); |
117 |
my $objects = $c->objects->search_rs($result_set); |
|
|
118 |
my $total = $result_set->search->count; |
| 119 |
|
| 120 |
$c->add_pagination_headers( |
| 121 |
{ |
| 122 |
total => ( |
| 123 |
$objects->is_paged |
| 124 |
? $objects->pager->total_entries |
| 125 |
: $objects->count |
| 126 |
), |
| 127 |
base_total => $total, |
| 128 |
params => $args, |
| 129 |
} |
| 130 |
); |
| 131 |
|
| 132 |
return $c->objects->to_api( $objects ); |
| 118 |
} |
133 |
} |
| 119 |
); |
134 |
); |
| 120 |
|
135 |
|
|
Lines 246-264
shouldn't be called twice in it.
Link Here
|
| 246 |
|
261 |
|
| 247 |
# Perform search |
262 |
# Perform search |
| 248 |
my $objects = $result_set->search( $filtered_params, $attributes ); |
263 |
my $objects = $result_set->search( $filtered_params, $attributes ); |
| 249 |
my $total = $result_set->search->count; |
|
|
| 250 |
|
| 251 |
$c->add_pagination_headers( |
| 252 |
{ |
| 253 |
total => ( |
| 254 |
$objects->is_paged |
| 255 |
? $objects->pager->total_entries |
| 256 |
: $objects->count |
| 257 |
), |
| 258 |
base_total => $total, |
| 259 |
params => $args, |
| 260 |
} |
| 261 |
); |
| 262 |
|
264 |
|
| 263 |
return $objects; |
265 |
return $objects; |
| 264 |
} |
266 |
} |
| 265 |
- |
|
|