Skip to content

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: internal/service: dropped errors

Lars Lehtonend0f3f3e573e1
diff --git a/internal/service/vote_service.go b/internal/service/vote_service.go
index 54fd432c..bccf9c48 100644
--- a/internal/service/vote_service.go
+++ b/internal/service/vote_service.go
@@ -124,6 +124,9 @@ func (vs *VoteService) VoteDown(ctx context.Context, req *schema.VoteReq) (resp
voteDownOperationInfo := vs.createVoteOperationInfo(ctx, req.UserID, false, objectInfo)
if req.IsCancel {
err = vs.voteRepo.CancelVote(ctx, voteDownOperationInfo)
+ if err != nil {
+ return nil, err
+ }
} else {
// cancel vote up if exist
err = vs.voteRepo.CancelVote(ctx, vs.createVoteOperationInfo(ctx, req.UserID, true, objectInfo))
@@ -131,6 +134,9 @@ func (vs *VoteService) VoteDown(ctx context.Context, req *schema.VoteReq) (resp
return nil, err
}
err = vs.voteRepo.Vote(ctx, voteDownOperationInfo)
+ if err != nil {
+ return nil, err
+ }
}
resp = &schema.VoteResp{}