Skip to content

Commit

Permalink
Reverse dependencies: read sort option from body
Browse files Browse the repository at this point in the history
The 'sort' parameter is passed from WEB as JSON in a POST request
as it is a complex structure (hash).
  • Loading branch information
mickeyn committed Nov 8, 2017
1 parent 773d3fa commit c05d777
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/MetaCPAN/Server/Controller/ReverseDependencies.pm
Expand Up @@ -15,7 +15,9 @@ sub dist : Path('dist') : Args(1) {
my ( $self, $c, $dist ) = @_;
$c->stash_or_detach(
$c->model('CPAN::Release')->reverse_dependencies(
$dist, @{ $c->req->params }{qw< page page_size sort >}
$dist,
@{ $c->req->params }{qw< page page_size >},
$c->read_param('sort')->[0]
)
);
}
Expand All @@ -24,7 +26,9 @@ sub module : Path('module') : Args(1) {
my ( $self, $c, $module ) = @_;
$c->stash_or_detach(
$c->model('CPAN::Release')->requires(
$module, @{ $c->req->params }{qw< page page_size sort >}
$module,
@{ $c->req->params }{qw< page page_size >},
$c->read_param('sort')->[0]
)
);
}
Expand Down

0 comments on commit c05d777

Please sign in to comment.