diff --git a/lib/Pear/LocalLoop.pm b/lib/Pear/LocalLoop.pm index 9890811..d37e5b9 100644 --- a/lib/Pear/LocalLoop.pm +++ b/lib/Pear/LocalLoop.pm @@ -148,6 +148,7 @@ sub startup { $api->post('/user-history')->to('api-user#post_user_history'); $api->post('/stats')->to('api-stats#post_index'); $api->post('/stats/leaderboard')->to('api-stats#post_leaderboards'); + $api->post('/stats/leaderboard/paged')->to('api-stats#post_leaderboards_paged'); $api->post('/outgoing-transactions')->to('api-transactions#post_transaction_list_purchases'); diff --git a/lib/Pear/LocalLoop/Controller/Api/Stats.pm b/lib/Pear/LocalLoop/Controller/Api/Stats.pm index b2f1a71..6081f3e 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Stats.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Stats.pm @@ -129,7 +129,6 @@ sub post_leaderboards_paged { if ( !defined $validation->param('page') || $validation->param('page') < 1 ) { my $user_position = $today_board->values->find({ entity_id => $c->stash->{api_user}->entity->id }); if { $user_position > 10 ) { - my $math1; int($user_position / 10) + 1 = $page; } } @@ -171,6 +170,7 @@ sub post_leaderboards_paged { leaderboard => [ @leaderboard_array ], user_position => defined $current_user_position ? $current_user_position->{position} : 0, page => $validation->param('page') || $page, + page_no => $today_values->pager->total_entries, }); }