Fix some syntaxe error

master
Daniel Berteaud 10 years ago
parent 2f3ad038c1
commit 91465f1c1b
  1. 11
      vroom.pl

@ -1322,8 +1322,8 @@ post '/*action' => [action => [qw/action admin\/action/]] => sub {
if (!$data){ if (!$data){
return $self->render( return $self->render(
json => { json => {
msg => $self->l($res->{msg}), msg => sprintf ($self->l('ERROR_ROOM_s_DOESNT_EXIST'), $room),
err => $res->{msg}, err => 'ERROR_ROOM_s_DOESNT_EXIST',
status => 'error' status => 'error'
}, },
); );
@ -1381,12 +1381,11 @@ post '/*action' => [action => [qw/action admin\/action/]] => sub {
} }
); );
} }
$res = $self->modify_room($data); if (!$self->modify_room($data)){
if (!$res->{ok}){
return $self->render( return $self->render(
json => { json => {
status => 'error', status => 'error',
msg => $self->l($res->{msg}) msg => $self->l('ERROR_OCCURRED')
} }
); );
} }
@ -1567,7 +1566,7 @@ post '/*action' => [action => [qw/action admin\/action/]] => sub {
locked => ($data->{locked}) ? 'yes' : 'no', locked => ($data->{locked}) ? 'yes' : 'no',
ask_for_name => ($data->{ask_for_name}) ? 'yes' : 'no', ask_for_name => ($data->{ask_for_name}) ? 'yes' : 'no',
notif => Mojo::JSON->new->encode({email => { %emailNotif }}), notif => Mojo::JSON->new->encode({email => { %emailNotif }}),
status => $res status => 'success'
}, },
); );
} }

Loading…
Cancel
Save