HTTP codes in lock_room API call

master
Daniel Berteaud 10 years ago
parent 1d299dedfc
commit d197d3c96d
  1. 8
      vroom.pl

@ -1377,18 +1377,22 @@ any '/api' => sub {
elsif ($req->{action} =~ m/(un)?lock_room/){ elsif ($req->{action} =~ m/(un)?lock_room/){
$room->{locked} = ($req->{action} eq 'lock_room') ? '1':'0'; $room->{locked} = ($req->{action} eq 'lock_room') ? '1':'0';
if ($self->modify_room($room)){ if ($self->modify_room($room)){
my $m = ($req->{action} eq 'lock_room') ? 'ROOM_LOCKED' : 'ROOM_UNLOCKED';
return $self->render( return $self->render(
json => { json => {
status => 'success', status => 'success',
msg => $self->l(($req->{action} eq 'lock_room') ? 'ROOM_LOCKED' : 'ROOM_UNLOCKED') msg => $self->l($m),
err => $m
} }
); );
} }
return $self->render( return $self->render(
json => { json => {
msg => $self->l('ERROR_OCCURRED'), msg => $self->l('ERROR_OCCURRED'),
err => 'ERROR_OCCURRED'
status => 'error' status => 'error'
} },
status => 503
); );
} }
# Handle activity pings sent every minute by each participant # Handle activity pings sent every minute by each participant

Loading…
Cancel
Save