HTTP codes in update_room_conf API call

master
Daniel Berteaud 10 years ago
parent d197d3c96d
commit fd9dcd006b
  1. 24
      public/js/vroom.js
  2. 6
      vroom.pl

@ -307,21 +307,21 @@ $('#configureRoomForm').submit(function(e){
} }
}) })
}, },
error: function() { error: function(data) {
$.notify(locale.ERROR_OCCURRED, 'error'); data = data.responseJSON;
}, if (data.msg){
success: function(data) { $.notify(data.msg, 'error');
$('#ownerPass,#ownerPassConfirm,#joinPass,#joinPassConfirm').val('');
if (data.status == 'success'){
$('#configureModal').modal('hide');
// Hide passwords inputs too
$('#joinPassFields,#ownerPassFields').hide();
$.notify(data.msg, 'info');
$('#configureRoomForm').trigger('room_conf_updated');
} }
else{ else{
$.notify(data.msg, 'error'); $.notify(locale.ERROR_OCCURRED, 'error');
} }
},
success: function(data) {
$('#ownerPass,#ownerPassConfirm,#joinPass,#joinPassConfirm').val('');
$('#configureModal').modal('hide');
$('#joinPassFields,#ownerPassFields').hide();
$.notify(data.msg, 'info');
$('#configureRoomForm').trigger('room_conf_updated');
} }
}); });
}); });

@ -1455,8 +1455,10 @@ any '/api' => sub {
return $self->render( return $self->render(
json => { json => {
status => 'error', status => 'error',
msg => $self->l('ERROR_OCCURRED') msg => $self->l('ERROR_OCCURRED'),
} err => 'ERROR_OCCURRED'
},
staus => 503
); );
} }
# Handle password (join and owner) # Handle password (join and owner)

Loading…
Cancel
Save