fix(comment): Remove the judgment condition that you are not able to edit the comment.

This commit is contained in:
LinkinStar 2022-12-23 10:22:13 +08:00
parent 40dea823e7
commit 06aa09bf35
1 changed files with 0 additions and 6 deletions

View File

@ -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