mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 22:45:46 +01:00
tweaks to make the ACP work better on tablets, some work on hidden groups
This commit is contained in:
@@ -150,7 +150,8 @@
|
||||
gid: gid,
|
||||
name: name,
|
||||
description: description,
|
||||
deleted: '0'
|
||||
deleted: '0',
|
||||
hidden: '0'
|
||||
})
|
||||
.exec(function (err) {
|
||||
Groups.get(gid, {}, callback);
|
||||
@@ -162,6 +163,16 @@
|
||||
});
|
||||
};
|
||||
|
||||
Groups.hide = function(gid) {
|
||||
Groups.exists(gid, function(err, exists) {
|
||||
if (exists) {
|
||||
Groups.update(gid, {
|
||||
hidden: '1'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Groups.update = function(gid, values, callback) {
|
||||
RDB.exists('gid:' + gid, function (err, exists) {
|
||||
if (!err && exists) {
|
||||
@@ -186,6 +197,7 @@
|
||||
Groups.getGidFromName(groupName, function(err, gid) {
|
||||
if (err || !gid) {
|
||||
Groups.create(groupName, '', function(err, groupObj) {
|
||||
Groups.hide(groupObj.gid);
|
||||
Groups.join(groupObj.gid, uid, callback);
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user