Skip to content

Commit 8f52562

Browse files
committed
adjust the form of input to be conventional.
As @haarg++ pointed out, this makes it poosible to retrieve with GET method like: curl 'http://localhost:5000/changes/by_releases?release=YAPPO/LINE-Bot-API-0.04&release=GUGOD/Hijk-0.28'
1 parent 9b27d3c commit 8f52562

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

lib/MetaCPAN/Server/Controller/Changes.pm

+10-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,16 @@ sub all : Chained('index') : PathPart('') : Args(0) {
6868
sub by_releases : Path('by_releases') : Args(0) {
6969
my ( $self, $c ) = @_;
7070

71-
# ArrayRef[ Dict[ author => Str, name => Str ] ]
72-
my $arg = $c->read_param("releases");
73-
my $ret = $c->model('CPAN::Release')->by_author_and_names($arg);
71+
my $ret = $c->model('CPAN::Release')->by_author_and_names([
72+
map {
73+
my @o = split('/', $_, 2);
74+
@o != 2 ? () : (+{
75+
author => $o[0],
76+
name => $o[1],
77+
})
78+
}
79+
@{ $c->read_param("release") }
80+
]);
7481

7582
my @changes;
7683
for my $release ( @{ $ret->{releases} } ) {

0 commit comments

Comments
 (0)