|
@@ -57,7 +57,6 @@ export class CommentService {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
items.forEach(comment => {
|
|
items.forEach(comment => {
|
|
|
- console.log(rootMap)
|
|
|
|
|
if (Boolean(comment.rootCommentId)) {
|
|
if (Boolean(comment.rootCommentId)) {
|
|
|
const root = rootMap.get(comment.rootCommentId)
|
|
const root = rootMap.get(comment.rootCommentId)
|
|
|
if (root.hasOwnProperty('childList')) {
|
|
if (root.hasOwnProperty('childList')) {
|
|
@@ -84,4 +83,12 @@ export class CommentService {
|
|
|
return await this.commentRepository.save(commentDto);
|
|
return await this.commentRepository.save(commentDto);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public async delete(id: number): Promise<void> {
|
|
|
|
|
+ const comment = await this.commentRepository.findOneBy({ id: +id })
|
|
|
|
|
+ if (comment) {
|
|
|
|
|
+ comment.isDel = true
|
|
|
|
|
+ await this.commentRepository.save(comment)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|