my $json = $c->stash('json');
unless ( defined $json->{data} ) {
$json->{data} = {};
}
unless ( defined $c->match->stack->[0]){
$json->{messa
ash( 'json' => $json );
}
}
);
}
$app->helper( data => sub{
my $self = shift;
my %data = ref $_[0] ? %{ $_[0] } : @_;
my $json = $self->stash('json');
$json = {
data => {}, message => [] } unless defined $json;
@{ $json->{ data } }{ keys %data } = values %data;
$self->stash( json => $json );
return $self;
});
$app->helper( message => sub {