adds suspendUser func and mutation.

This commit is contained in:
gaba
2017-03-02 15:54:50 -08:00
parent 1899dcbb7e
commit 2fa832a3f4
9 changed files with 69 additions and 18 deletions
+16
View File
@@ -378,6 +378,22 @@ module.exports = class UsersService {
});
}
/**
* Suspend a user. It changes the status to BANNED and canEditName to True.
* @param {String} id id of a user
* @param {Function} done callback after the operation is complete
*/
static suspendUser(id) {
return UserModel.update({
id
}, {
$set: {
status: 'BANNED',
canEditName: true
}
});
}
/**
* Finds a user with the id.
* @param {String} id user id (uuid)