Permalink
Browse files

/rating/by_distributions: change output structure

Make the distributions output a hash.
  • Loading branch information...
1 parent dfd83dd commit ac145df16d05074eec25bffa01dc9b53ebdabd25 @mickeyn mickeyn committed Jul 4, 2017
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/MetaCPAN/Document/Rating.pm
@@ -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}
};
}

0 comments on commit ac145df

Please sign in to comment.