mirror of
https://github.com/dani/vroom.git
synced 2024-06-01 21:11:41 +02:00
HTTP codes in lock_room API call
This commit is contained in:
parent
1d299dedfc
commit
d197d3c96d
8
vroom.pl
8
vroom.pl
|
@ -1377,18 +1377,22 @@ any '/api' => sub {
|
|||
elsif ($req->{action} =~ m/(un)?lock_room/){
|
||||
$room->{locked} = ($req->{action} eq 'lock_room') ? '1':'0';
|
||||
if ($self->modify_room($room)){
|
||||
my $m = ($req->{action} eq 'lock_room') ? 'ROOM_LOCKED' : 'ROOM_UNLOCKED';
|
||||
return $self->render(
|
||||
json => {
|
||||
status => 'success',
|
||||
msg => $self->l(($req->{action} eq 'lock_room') ? 'ROOM_LOCKED' : 'ROOM_UNLOCKED')
|
||||
msg => $self->l($m),
|
||||
err => $m
|
||||
}
|
||||
);
|
||||
}
|
||||
return $self->render(
|
||||
json => {
|
||||
msg => $self->l('ERROR_OCCURRED'),
|
||||
err => 'ERROR_OCCURRED'
|
||||
status => 'error'
|
||||
}
|
||||
},
|
||||
status => 503
|
||||
);
|
||||
}
|
||||
# Handle activity pings sent every minute by each participant
|
||||
|
|
Loading…
Reference in New Issue
Block a user