You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by li...@apache.org on 2024/05/06 08:52:17 UTC

(incubator-answer-plugins) 03/09: fix(review): fixed the review switch check

This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git

commit 9fb4898223e46c2eb8614b5c07b130aa4d0c07dc
Author: kumfo <ku...@sifou.com>
AuthorDate: Tue Apr 16 14:42:46 2024 +0800

    fix(review): fixed the review switch check
---
 reviewer-basic/basic.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/reviewer-basic/basic.go b/reviewer-basic/basic.go
index c4d2477..69a63c1 100644
--- a/reviewer-basic/basic.go
+++ b/reviewer-basic/basic.go
@@ -59,8 +59,8 @@ func (r *Reviewer) Info() plugin.Info {
 
 func (r *Reviewer) Review(content *plugin.ReviewContent) (result *plugin.ReviewResult) {
 	result = &plugin.ReviewResult{Approved: true, ReviewStatus: plugin.ReviewStatusApproved}
-	// If the post does not need review, return directly
-	if !r.Config.PostNeedReview {
+	// this switch is true and have any other approved post, return directly
+	if r.Config.PostNeedReview && content.Author.ApprovedQuestionAmount+content.Author.ApprovedAnswerAmount > 1 {
 		return result
 	}
 	// If the author is admin, no need to review