Skip to content

Commit

Permalink
Merge pull request #710 from metacpan/mickey/rating_by_distributions_…
Browse files Browse the repository at this point in the history
…to_hash

/rating/by_distributions: change output structure
  • Loading branch information
oalders committed Jul 4, 2017
2 parents dfd83dd + ac145df commit bb6d242
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/MetaCPAN/Document/Rating.pm
Expand Up @@ -93,13 +93,13 @@ sub by_distributions {
);
return unless $ret->{hits}{total};

my $data = [ map { $_->{key} => $_->{ratings_dist} }
@{ $ret->{aggregations}{ratings}{buckets} } ];
my %distributions = map { $_->{key} => $_->{ratings_dist} }
@{ $ret->{aggregations}{ratings}{buckets} };

return {
releases => $data,
total => $ret->{hits}{total},
took => $ret->{took}
distributions => \%distributions,
total => $ret->{hits}{total},
took => $ret->{took}
};
}

Expand Down

0 comments on commit bb6d242

Please sign in to comment.