Skip to content

Commit ad90f2a

Browse files
authored
Merge pull request #5 from metacpan/haarg/source-not-fields
use _source not fields
2 parents 10767e4 + 17f0107 commit ad90f2a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/MetaCPAN/V0Shim.pm

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,12 @@ sub release_data {
418418
],
419419
},
420420
},
421-
_source => [ 'stat' ],
422-
fields => [ 'download_url', 'status', 'version' ],
421+
_source => [ qw(
422+
download_url
423+
stat
424+
status
425+
version
426+
) ],
423427
};
424428

425429
my $ua = $self->ua;
@@ -437,10 +441,10 @@ sub release_data {
437441
my $hits = $data->{hits}{hits} || die $data;
438442

439443
map +{
440-
download_url => $_->{fields}{download_url},
441-
status => $_->{fields}{status},
444+
download_url => $_->{_sources}{download_url},
445+
status => $_->{_source}{status},
442446
stat => $_->{_source}{stat},
443-
version => $_->{fields}{version},
447+
version => $_->{_source}{version},
444448
}, @$hits;
445449
}
446450

0 commit comments

Comments
 (0)