Added error flag to validation errors and added age_range api endpoint

This commit is contained in:
Tom Bloor 2017-04-23 14:02:10 +01:00
parent 6fac2058bc
commit b03b7ccc5f
3 changed files with 25 additions and 0 deletions

View file

@ -62,6 +62,7 @@ sub startup {
json => {
success => Mojo::JSON->false,
message => $c->error_messages->{$val}->{$check}->{message},
error => $check,
},
status => $c->error_messages->{$val}->{$check}->{status},
);
@ -98,6 +99,9 @@ sub startup {
$r->post('/register')->to('register#register');
$r->any('/logout')->to('root#auth_logout');
my $api_public_get = $r->under('/api');
$api_public_get->get('/info/ages')->to('api-info#get_ages');
# Always available api routes
my $api_public = $r->under('/api')->to('api-auth#check_json');