Skip to content

Commit

Permalink
Merge pull request #700 from metacpan/mickey/release_latest_by_distri…
Browse files Browse the repository at this point in the history
…bution_return_single_element

/release/latest_by_distribution: return one element
  • Loading branch information
oalders committed Jun 28, 2017
2 parents fd47fe0 + 6e42880 commit 948ef6f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/MetaCPAN/Document/Release.pm
Expand Up @@ -670,13 +670,13 @@ sub latest_by_distribution {
);
return unless $ret->{hits}{total};

my $data = [ map { $_->{_source} } @{ $ret->{hits}{hits} } ];
my $data = $ret->{hits}{hits}[0]{_source};
single_valued_arrayref_to_scalar($data);

return {
took => $ret->{took},
releases => $data,
total => $ret->{hits}{total}
release => $data,
took => $ret->{took},
total => $ret->{hits}{total}
};
}

Expand Down

0 comments on commit 948ef6f

Please sign in to comment.