Commit ea7c891e authored by 陈家荣's avatar 陈家荣

修改了更新评论

parent ecd5e81b
......@@ -32,7 +32,7 @@ exports.getCommentById=function(cid,callback){
};
//根据ID更新评论
exports.updateCommentById=function(cid,status,callback){
exports.updateCommentStatusById=function(cid,status,callback){
ForumComment.update({ _id: cid}, {"status" : status},null,function(err,result){
if (err) {
console.error(err);
......@@ -44,6 +44,20 @@ exports.updateCommentById=function(cid,status,callback){
});
};
//根据ID更新评论 entity
exports.updateCommentById=function(cid,entity,callback){
ForumComment.update({ _id: cid}, entity, null, function(err,result){
if (err) {
console.error(err);
callback(err,null);
} else {
console.log(result);
callback(null,null);
}
});
};
//根据ID删除评论
exports.deleteCommentById=function(cid,callback){
ForumComment.remove({ _id: cid},function(err,result){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment