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

aaa

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