respond_to correction

This commit is contained in:
Luc Didry 2017-07-19 20:26:26 +02:00
parent 1c2cee539d
commit abebf60861
1 changed files with 12 additions and 6 deletions

View File

@ -391,9 +391,11 @@ sub delete {
$msg = $c->l('File deleted'); $msg = $c->l('File deleted');
} }
return $c->respond_to( return $c->respond_to(
json => {
json => { json => {
success => true, success => true,
msg => $msg msg => $msg
}
}, },
any => sub { any => sub {
$c->render( $c->render(
@ -406,9 +408,11 @@ sub delete {
} else { } else {
my $msg = $c->l('Could not find the file. Are you sure of the URL and the token?'); my $msg = $c->l('Could not find the file. Are you sure of the URL and the token?');
return $c->respond_to( return $c->respond_to(
json => {
json => { json => {
success => false, success => false,
msg => $msg msg => $msg
}
}, },
any => sub { any => sub {
$c->render( $c->render(
@ -422,9 +426,11 @@ sub delete {
} else { } else {
my $msg = $c->l('Could not delete the file. You are not authenticated.'); my $msg = $c->l('Could not delete the file. You are not authenticated.');
return $c->respond_to( return $c->respond_to(
json => {
json => { json => {
success => false, success => false,
msg => $msg msg => $msg
}
}, },
any => sub { any => sub {
$c->render( $c->render(