moved groups admin socket calls into admin file instead of standalone groups file

This commit is contained in:
Julian Lam
2014-01-13 12:09:13 -05:00
parent 4453d055ea
commit 619fe74fc0
3 changed files with 44 additions and 45 deletions

View File

@@ -1,39 +0,0 @@
var groups = require('../groups'),
SocketGroups = {};
SocketGroups.create = function(data, callback) {
groups.create(data.name, data.description, function(err, groupObj) {
callback(err ? err.message : null, groupObj || undefined);
});
};
SocketGroups.delete = function(gid, callback) {
groups.destroy(gid, function(err) {
callback(err ? err.message : null, err ? null : 'OK');
});
};
SocketGroups.get = function(gid, callback) {
groups.get(gid, {
expand: true
}, function(err, groupObj) {
callback(err ? err.message : null, groupObj || undefined);
});
};
SocketGroups.join = function(data, callback) {
groups.join(data.gid, data.uid, callback);
};
SocketGroups.leave = function(data, callback) {
groups.leave(data.gid, data.uid, callback);
};
SocketGroups.update = function(data, callback) {
groups.update(data.gid, data.values, function(err) {
callback(err ? err.message : null);
});
};
module.exports = SocketGroups;