Fixed stats endpoint for leaderboards on entity upgrade

This commit is contained in:
Tom Bloor 2017-08-31 18:31:42 +01:00
parent 96c8fa16c8
commit e91863a3d7
2 changed files with 15 additions and 15 deletions

View file

@ -84,14 +84,14 @@ sub post_leaderboards {
/,
{ display_name => 'customer.display_name' },
],
join => { user => 'customer' },
join => { entity => 'customer' },
},
);
$today_values->result_class( 'DBIx::Class::ResultClass::HashRefInflator' );
my @leaderboard_array = $today_values->all;
my $current_user_position = $today_values->find({ user_id => $c->stash->{api_user}->id });
my $current_user_position = $today_values->find({ entity_id => $c->stash->{api_user}->entity->id });
return $c->render( json => {
success => Mojo::JSON->true,