diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-10-11 12:07:20 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-04-29 00:59:09 -0300 |
commit | 485d6d657761370dc200d9cdb023ad564c23c4e9 (patch) | |
tree | 51780af96b14ebdc716922fdc5fa647310ab45b4 /settings/js/users | |
parent | 2507e7459d42e47f0581aeb69b738fec6497c6b5 (diff) | |
download | nextcloud-server-485d6d657761370dc200d9cdb023ad564c23c4e9.tar.gz nextcloud-server-485d6d657761370dc200d9cdb023ad564c23c4e9.zip |
use proper return codes and handle failure cases
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'settings/js/users')
-rw-r--r-- | settings/js/users/users.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 2a0b0c09a92..387709cd64c 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -949,7 +949,15 @@ $(document).ready(function () { OC.dialogs.alert(result.data.message, t('settings', 'Error while changing status of {user}', {user: uid})); } } - ); + ).fail(function(result){ + var message = 'Unknown error'; + if( result.responseJSON && + result.responseJSON.data && + result.responseJSON.data.message) { + message = result.responseJSON.data.message; + } + OC.dialogs.alert(message, t('settings', 'Error while changing status of {user}', {user: uid})); + }); }); // init the quota field select box after it is shown the first time |