|
|
@@ -154,24 +154,24 @@ module.exports = function(crowi) {
|
|
|
};
|
|
|
|
|
|
// TBD: グループの完全削除
|
|
|
- // userGroupSchema.statics.removeCompletelyById = function(id, callback) {
|
|
|
- // var UserGroup = this;
|
|
|
- // UserGroup.findById(id, function (err, userGroupData) {
|
|
|
- // if (!userGroupData) {
|
|
|
- // return callback(err, null);
|
|
|
- // }
|
|
|
+ userGroupSchema.statics.removeCompletelyById = function(id, callback) {
|
|
|
+ var UserGroup = this;
|
|
|
+ UserGroup.findById(id, function (err, userGroupData) {
|
|
|
+ if (!userGroupData) {
|
|
|
+ return callback(err, null);
|
|
|
+ }
|
|
|
|
|
|
- // debug('Removing userGroup:', userGroupData);
|
|
|
+ debug('Removing userGroup:', userGroupData);
|
|
|
|
|
|
- // userGroupData.remove(function(err) {
|
|
|
- // if (err) {
|
|
|
- // return callback(err, null);
|
|
|
- // }
|
|
|
+ userGroupData.remove(function(err) {
|
|
|
+ if (err) {
|
|
|
+ return callback(err, null);
|
|
|
+ }
|
|
|
|
|
|
- // return callback(null, 1);
|
|
|
- // });
|
|
|
- // });
|
|
|
- // };
|
|
|
+ return callback(null, 1);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
// TBD: グループ生成(名前が要る)
|
|
|
userGroupSchema.statics.createGroupByName = function(name, callback) {
|