mirror of https://gitee.com/answerdev/answer.git
fix(comment): Remove the judgment condition that you are not able to edit the comment.
This commit is contained in:
parent
40dea823e7
commit
06aa09bf35
|
@ -168,17 +168,11 @@ func (cs *CommentService) AddComment(ctx context.Context, req *schema.AddComment
|
|||
|
||||
// RemoveComment delete comment
|
||||
func (cs *CommentService) RemoveComment(ctx context.Context, req *schema.RemoveCommentReq) (err error) {
|
||||
if err := cs.checkCommentWhetherOwner(ctx, req.UserID, req.CommentID); err != nil {
|
||||
return err
|
||||
}
|
||||
return cs.commentRepo.RemoveComment(ctx, req.CommentID)
|
||||
}
|
||||
|
||||
// UpdateComment update comment
|
||||
func (cs *CommentService) UpdateComment(ctx context.Context, req *schema.UpdateCommentReq) (err error) {
|
||||
if err := cs.checkCommentWhetherOwner(ctx, req.UserID, req.CommentID); err != nil {
|
||||
return err
|
||||
}
|
||||
comment := &entity.Comment{}
|
||||
_ = copier.Copy(comment, req)
|
||||
comment.ID = req.CommentID
|
||||
|
|
Loading…
Reference in New Issue