Commit 065902a8 authored by 陈家荣's avatar 陈家荣

aaa

parent db3a8266
......@@ -290,7 +290,7 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
forumThreadService.getById(tid, function(err, result) {
if (err) {
console.error(err);
callback(err, null);
res.json(returnCode.BUSY);
} else {
result.comment_count -= 1;
var commentList = result.comments;
......@@ -298,7 +298,7 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
forumThreadService.updateThreadById(tid, result, function(err, result) {
if (err) {
console.error(err);
callback(err, null);
res.json(returnCode.BUSY);
} else {
res.json(returnCode.SUCCESS);
}
......@@ -308,9 +308,9 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
} else { // 删除子评论
// 更新文章评论 - 1
forumThreadService.updateThreadCommentCount(tid, comment_count - 1, function(err, result) {
forumThreadService.updateThreadCommentCount(tid, function(err, result) {
if (err) {
callback(err, null);
res.json(returnCode.BUSY);
}
});
......@@ -319,7 +319,7 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
forumCommentService.getCommentById(parent_cid, function(err, result) {
if (err) {
console.error(err);
callback(err, null);
res.json(returnCode.BUSY);
} else {
var commentList = result.comments;
result.comments = forumCommentService.remove(commentList, cid);
......@@ -382,15 +382,15 @@ router.post('/thread/comment/update/:cid/comments', function(req, res, next) {
forumCommentService.getCommentById(cid, function(err, result) {
if (err) {
console.error(err);
callback(err, null);
res.json(returnCode.BUSY);
} else {
var commentList = result.comments;
result.comments.push(replayComment_id);
forumCommentService.updateCommentById(cid, result, function(err, result) {
if (err) {
console.error(err);
res.json(returnCode.BUSY);
} else {
res.json(returnCode.SUCCESS);
......@@ -447,6 +447,7 @@ router.post('/thread/comment/add', function(req, res, next) {
};
forumUserService.createUser(userentity, function(err, doc) {
if (err) {
console.log(err);
res.json(returnCode.BUSY);
} else {
entity.from = doc._id;
......@@ -502,7 +503,7 @@ router.post('/thread/:tid/updateComments', function(req, res, next) {
forumThreadService.getById(tid, function(err, result) {
if (err) {
console.error(err);
callback(err, null);
res.json(returnCode.BUSY);
} else {
result.comments.push(cid);
result.comment_count += 1;
......@@ -510,7 +511,7 @@ router.post('/thread/:tid/updateComments', function(req, res, next) {
forumThreadService.updateThreadById(tid, result, function(err, result) {
if (err) {
console.error(err);
callback(err, null);
res.json(returnCode.BUSY);
} else {
res.json(returnCode.SUCCESS);
}
......
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