api: createGroup

This commit is contained in:
Tyler Renelle
2013-09-01 20:50:36 -04:00
parent ac992ea865
commit 010995b38b
4 changed files with 49 additions and 10 deletions

View File

@@ -83,6 +83,14 @@ api.getGroups = function(req, res, next) {
})
};
api.createGroup = function(req, res, next) {
var group = new Group(req.body);
group.save(function(err, saved){
if (err) return res.json(500,{err:err});
res.json(saved);
})
}
api.attachGroup = function(req, res, next) {
Group.findById(req.params.gid, function(err, group){
if(err) return res.json(500, {err:err});