Fix changeStatus

This commit is contained in:
gaba
2016-11-22 12:32:33 -08:00
parent f7c4e8bf24
commit ff6ee76d3d
5 changed files with 18 additions and 19 deletions
+9 -8
View File
@@ -425,15 +425,16 @@ UserService.setStatus = (id, status, comment_id) => {
if (status === 'banned') {
return UserService.disableUser(id)
.then(() => {
return Comment.setStatus(comment_id, 'rejected').then(() => {
return UserModel.update({
id: id
}, {
$set: {
status: status
}
return Comment.changeStatus(comment_id, 'rejected')
.then(() => {
return UserModel.update({
id: id
}, {
$set: {
status: status
}
});
});
});
});
}