summaryrefslogtreecommitdiffstats
path: root/settings/js/users/groups.js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-12-08 16:35:13 +0100
committerLukas Reschke <lukas@owncloud.com>2014-12-08 16:35:13 +0100
commitc23957811d31812cc9193eae0c83f6d7648b971b (patch)
tree114f922795e913d2a71e251f48d43b6833b7e9c2 /settings/js/users/groups.js
parent5f43809ace0068cd577959e4a522292ec3a1c9bb (diff)
downloadnextcloud-server-c23957811d31812cc9193eae0c83f6d7648b971b.tar.gz
nextcloud-server-c23957811d31812cc9193eae0c83f6d7648b971b.zip
React on other statuscodes than 200
Diffstat (limited to 'settings/js/users/groups.js')
-rw-r--r--settings/js/users/groups.js29
1 files changed, 12 insertions, 17 deletions
diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js
index 40872785e30..c06bc5ff14b 100644
--- a/settings/js/users/groups.js
+++ b/settings/js/users/groups.js
@@ -89,24 +89,19 @@ GroupList = {
id: groupname
},
function (result) {
- if (result.status !== 'success') {
- OC.dialogs.alert(result.data.message,
- t('settings', 'Error creating group'));
+ if (result.groupname) {
+ var addedGroup = result.groupname;
+ UserList.availableGroups = $.unique($.merge(UserList.availableGroups, [addedGroup]));
+ GroupList.addGroup(result.groupname);
+
+ $('.groupsselect, .subadminsselect')
+ .append($('<option>', { value: result.groupname })
+ .text(result.groupname));
}
- else {
- if (result.data.groupname) {
- var addedGroup = result.data.groupname;
- UserList.availableGroups = $.unique($.merge(UserList.availableGroups, [addedGroup]));
- GroupList.addGroup(result.data.groupname);
-
- $('.groupsselect, .subadminsselect')
- .append($('<option>', { value: result.data.groupname })
- .text(result.data.groupname));
- }
- GroupList.toggleAddGroup();
- }
- }
- );
+ GroupList.toggleAddGroup();
+ }).fail(function(result, textStatus, errorThrown) {
+ OC.dialogs.alert(result.responseJSON.message, t('settings', 'Error creating group'));
+ });
},
update: function () {