From 91465f1c1b6b15e7507838c6d663f2feb3ccb2f0 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 16 Oct 2014 21:30:33 +0200 Subject: [PATCH] Fix some syntaxe error --- vroom.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/vroom.pl b/vroom.pl index bcc138e..6cd334b 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1322,8 +1322,8 @@ post '/*action' => [action => [qw/action admin\/action/]] => sub { if (!$data){ return $self->render( json => { - msg => $self->l($res->{msg}), - err => $res->{msg}, + msg => sprintf ($self->l('ERROR_ROOM_s_DOESNT_EXIST'), $room), + err => 'ERROR_ROOM_s_DOESNT_EXIST', status => 'error' }, ); @@ -1381,12 +1381,11 @@ post '/*action' => [action => [qw/action admin\/action/]] => sub { } ); } - $res = $self->modify_room($data); - if (!$res->{ok}){ + if (!$self->modify_room($data)){ return $self->render( json => { 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', ask_for_name => ($data->{ask_for_name}) ? 'yes' : 'no', notif => Mojo::JSON->new->encode({email => { %emailNotif }}), - status => $res + status => 'success' }, ); }