Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return addCommentFetch(comment).then(result => {
const { data } = result;
if (data) {
sucCb();
toast.success("发表评论成功",{position:toast.position.TOP_RIGHT})
dispatch(addComment(data.comment));
}
});
}
async _deleteComment(){
let {comment,index,current} = this.props
let result =await deleteComment({
articleId:comment.postId,
commentId:comment._id,
user_id:current
})
if(result.data){
this.props.deleteComment(index)
toast.success("删除成功",{
position:toast.position.TOP_RIGHT,
})
}
}
render(){