A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix(comment): Remove the judgment condition that you are not able to edit the comment.
LinkinStar06aa09bf350a
diff --git a/internal/service/comment/comment_service.go b/internal/service/comment/comment_service.goindex c9a7cbd0..d23ef7c9 100644--- a/internal/service/comment/comment_service.go+++ b/internal/service/comment/comment_service.go@@ -168,17 +168,11 @@ func (cs *CommentService) AddComment(ctx context.Context, req *schema.AddComment// RemoveComment delete commentfunc (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 commentfunc (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