- Notifications
You must be signed in to change notification settings - Fork 236
[WIP] some hacks to allow working against ES 2.3 index #1667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 19 commits
4993be0 0f7590f 3f19454 61d35c3 a8f842e ef25b87 61fa14f f0707df ff7cdae 26b04dd b598369 8b71bbe dfba1ff 3a5aa3a a17ec46 2daa50b 0617591 661a1d9 2b0e8ce 01a3b3e b0d9141 File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -6,6 +6,7 @@ use List::Util (); | |
| use DateTime::Format::ISO8601 (); | ||
| use namespace::autoclean; | ||
| use Locale::Country (); | ||
| use MetaCPAN::Web::Util qw( fix_structure ); | ||
| | ||
| BEGIN { extends 'MetaCPAN::Web::Controller' } | ||
| | ||
| | @@ -50,15 +51,15 @@ sub index : Chained('root') PathPart('') Args(0) { | |
| my ( $author, $data ) = ( $author_cv->recv, $releases_cv->recv ); | ||
| $c->detach('/not_found') unless ( $author->{pauseid} ); | ||
| | ||
| my $faves_cv = $c->model('API::Favorite')->by_user( $author->{user} ); | ||
| my $faves_cv = $c->model('API::Favorite')->by_user( $author->{pauseid} ); | ||
| ||
| | ||
| my $faves_data = $faves_cv->recv; | ||
| my $faves = [ | ||
| sort { $b->{date} cmp $a->{date} } | ||
| map { $_->{fields} } @{ $faves_data->{hits}{hits} } | ||
| ]; | ||
| | ||
| my $releases = [ map { $_->{fields} } @{ $data->{hits}->{hits} } ]; | ||
| my $releases = [ map { fix_structure($_->{fields}) } @{ $data->{hits}->{hits} } ]; | ||
| my $date = List::Util::max | ||
| map { DateTime::Format::ISO8601->parse_datetime( $_->{date} ) } | ||
| @$releases; | ||
| | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍