Skip to content

Commit

Permalink
Merge pull request #703 from metacpan/mickey/release_by_author_and_na…
Browse files Browse the repository at this point in the history
…me_return_single_result

/release/by_author_and_name: return one element
  • Loading branch information
oalders committed Jun 29, 2017
2 parents 2a39a04 + 9773344 commit b0df91f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/MetaCPAN/Document/Release.pm
Expand Up @@ -633,13 +633,13 @@ sub by_author_and_name {
);
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}
took => $ret->{took},
release => $data,
total => $ret->{hits}{total}
};
}

Expand Down

0 comments on commit b0df91f

Please sign in to comment.