mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-05 14:47:12 -04:00
fix duble error checking
fix whitespace coding convention
This commit is contained in:
parent
8bff85cdb2
commit
f7d8f68c13
3 changed files with 49 additions and 53 deletions
|
@ -106,29 +106,25 @@ exports.deleteGroup = function(groupID, callback)
|
|||
db.get("groups", function (err, groups)
|
||||
{
|
||||
if(ERR(err, callback)) return;
|
||||
|
||||
if(ERR(err, callback)) return;
|
||||
|
||||
existingGroups = [];
|
||||
|
||||
existingGroups = [];
|
||||
|
||||
if(groups != undefined)
|
||||
if(groups != undefined)
|
||||
{
|
||||
for(var key in groups['groups'])
|
||||
{
|
||||
for(var key in groups['groups'])
|
||||
{
|
||||
if(groupID != groups['groups'][key])
|
||||
{
|
||||
existingGroups.push(groups['groups'][key]);
|
||||
}
|
||||
}
|
||||
if(groupID != groups['groups'][key])
|
||||
{
|
||||
existingGroups.push(groups['groups'][key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
db.set("groups", {groups: existingGroups});
|
||||
db.set("groups", {groups: existingGroups});
|
||||
});
|
||||
|
||||
|
||||
db.remove("group2sessions:" + groupID);
|
||||
db.remove("group:" + groupID);
|
||||
|
||||
|
||||
callback();
|
||||
}
|
||||
], function(err)
|
||||
|
@ -169,10 +165,10 @@ exports.createGroup = function(callback)
|
|||
if(ERR(err, callback)) return;
|
||||
if(responseGroups != undefined)
|
||||
{
|
||||
for(var key in responseGroups['groups'])
|
||||
{
|
||||
existingGroups.push(responseGroups['groups'][key]);
|
||||
}
|
||||
for(var key in responseGroups['groups'])
|
||||
{
|
||||
existingGroups.push(responseGroups['groups'][key]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue