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/Medals.pm
2021-03-20 19:03:59 +00:00

48 lines
1.2 KiB
Perl

package Pear::LocalLoop::Controller::Api::V1::User::Medals;
use Mojo::Base 'Mojolicious::Controller';
use Mojo::JSON qw/true false/;
sub idx {
my $c = shift;
my $validation = $c->validation;
$validation->input( $c->stash->{api_json} );
# Placeholder data
my $global_placeholder = {
group_name => {
threshold => {
awarded => true,
awarded_at => '2017-01-02T01:00:00Z',
threshold => 1,
points => 1,
},
total => 1,
},
};
my $organisation_placeholder = {
org_id => {
group_name => {
threshold => {
awarded => true,
awarded_at => '2017-01-02T01:00:00Z',
threshold => 1,
points => 1,
multiplier => 1,
},
total => 1,
},
name => 'Placeholder',
},
};
return $c->render(
json => {
success => Mojo::JSON->true,
global => $global_placeholder,
organisation => $organisation_placeholder,
}
);
}
1;