Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pisns-forum-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
scrmGroup
pisns-forum-api
Commits
8bbea139
Commit
8bbea139
authored
Apr 24, 2015
by
陈家荣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'development' of git.wxpai.cn:scrmgroup/pisns-forum-api into development
Conflicts: app/controllers/admin/forumThread.js
parents
3e3442e8
672e676a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
29 deletions
+48
-29
forumThread.js
app/controllers/admin/forumThread.js
+48
-29
No files found.
app/controllers/admin/forumThread.js
View file @
8bbea139
...
@@ -328,14 +328,12 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
...
@@ -328,14 +328,12 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
// var commentList = result.comments;
// var commentList = result.comments;
// result.comments = forumThreadService.remove(commentList, cid);
// result.comments = forumThreadService.remove(commentList, cid);
var
commentList
=
result
.
comments
;
//
var commentList = result.comments;
var
comments
=
forumThreadService
.
remove
(
commentList
,
cid
);
//
var comments = forumThreadService.remove(commentList, cid);
forumThreadService
.
updateThreadById
(
tid
,
{
forumThreadService
.
updateThreadById
(
tid
,
{
comments
:
comments
,
"$pull"
:
{
"comments"
:
{
"_id"
:
cid
}},
$inc
:
{
$inc
:
{
comment_count
:
-
1
}
comment_count
:
-
1
}
},
function
(
err
,
result
)
{
},
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
...
@@ -365,7 +363,12 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
...
@@ -365,7 +363,12 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
var
commentList
=
result
.
comments
;
var
commentList
=
result
.
comments
;
var
comments
=
forumCommentService
.
remove
(
commentList
,
cid
);
var
comments
=
forumCommentService
.
remove
(
commentList
,
cid
);
forumCommentService
.
updateCommentById
(
parent_cid
,
{
forumCommentService
.
updateCommentById
(
parent_cid
,
{
comments
:
comments
"$pull"
:
{
"comments"
:
{
"_id"
:
cid
}
}
},
function
(
err
,
result
)
{
},
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
...
@@ -428,15 +431,7 @@ router.post('/thread/comment/update/:cid/comments', function(req, res, next) {
...
@@ -428,15 +431,7 @@ router.post('/thread/comment/update/:cid/comments', function(req, res, next) {
router
.
post
(
'/thread/comment/update/:cid/comments'
,
function
(
req
,
res
,
next
)
{
router
.
post
(
'/thread/comment/update/:cid/comments'
,
function
(
req
,
res
,
next
)
{
var
cid
=
req
.
params
.
cid
||
null
;
var
cid
=
req
.
params
.
cid
||
null
;
var
replayComment_id
=
req
.
body
.
replayComment_id
;
var
replayComment_id
=
req
.
body
.
replayComment_id
;
// 获取评论的子评论列表
forumCommentService
.
getCommentById
(
cid
,
function
(
err
,
result
)
{
if
(
err
)
{
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
var
commentList
=
result
.
comments
;
result
.
comments
.
push
(
replayComment_id
);
forumCommentService
.
updateCommentById
(
cid
,
{
forumCommentService
.
updateCommentById
(
cid
,
{
$push
:
{
$push
:
{
...
@@ -451,9 +446,33 @@ router.post('/thread/comment/update/:cid/comments', function(req, res, next) {
...
@@ -451,9 +446,33 @@ router.post('/thread/comment/update/:cid/comments', function(req, res, next) {
res
.
json
(
returnCode
.
SUCCESS
);
res
.
json
(
returnCode
.
SUCCESS
);
}
}
});
});
// 获取评论的子评论列表
// forumCommentService.getCommentById(cid, function(err, result) {
// if (err) {
// console.error(err);
// res.json(returnCode.BUSY);
// } else {
// // var commentList = result.comments;
// // result.comments.push(replayComment_id);
// forumCommentService.updateCommentById(cid, {
// $push: {
// comments: replayComment_id
// }
// },
// function(err, result) {
// if (err) {
// console.error(err);
// res.json(returnCode.BUSY);
// } else {
// res.json(returnCode.SUCCESS);
// }
// });
// }
// });
}
});
});
});
//添加评论
//添加评论
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment