This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Foodloop-Server/lib/Pear/LocalLoop/Controller/Api/V1/User/Points.pm

40 lines
941 B
Perl
Raw Normal View History

2018-02-05 14:58:55 +00:00
package Pear::LocalLoop::Controller::Api::V1::User::Points;
use Mojo::Base 'Mojolicious::Controller';
use Mojo::JSON qw/true false/;
2021-03-20 19:03:59 +00:00
sub idx {
2021-03-20 12:09:50 +00:00
my $c = shift;
2018-02-05 14:58:55 +00:00
2021-03-20 12:09:50 +00:00
my $validation = $c->validation;
$validation->input( $c->stash->{api_json} );
2018-02-05 14:58:55 +00:00
2021-03-20 12:09:50 +00:00
# Placeholder data
my $snippets_placeholder = {
points_total => 1,
point_last => 1,
trans_count => 1,
avg_multi => 1,
};
2018-02-05 14:58:55 +00:00
2021-03-20 12:09:50 +00:00
my $widget_line_placeholder = { labels => [], data => [] };
2018-02-05 14:58:55 +00:00
2021-03-20 12:09:50 +00:00
my $widget_progress_placeholder = {
this_week => 1,
last_week => 1,
max => 1,
sum => 1,
count => 1,
};
2018-02-05 14:58:55 +00:00
2021-03-20 12:09:50 +00:00
return $c->render(
json => {
success => Mojo::JSON->true,
snippets => $snippets_placeholder,
widget_line => $widget_line_placeholder,
widget_progress => $widget_progress_placeholder,
}
);
2018-02-05 14:58:55 +00:00
}
1;