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: Apply code from review

Luffy818329138111
diff --git a/internal/repo/activity/vote_repo.go b/internal/repo/activity/vote_repo.go
index 7e8b02e6..37d907b0 100644
--- a/internal/repo/activity/vote_repo.go
+++ b/internal/repo/activity/vote_repo.go
@@ -240,6 +240,9 @@ func (vr *VoteRepo) setActivityRankToZeroIfUserReachLimit(ctx context.Context, s
op *schema.VoteOperationInfo, userInfoMapping map[string]*entity.User, maxDailyRank int) (err error) {
// check if user reach daily rank limit
for _, activity := range op.Activities {
+ if userInfoMapping[activity.ActivityUserID] == nil {
+ continue
+ }
if activity.Rank > 0 {
// check if reach max daily rank
reach, err := vr.userRankRepo.CheckReachLimit(ctx, session, activity.ActivityUserID, maxDailyRank)
diff --git a/internal/service/question_common/question.go b/internal/service/question_common/question.go
index c425d0a6..8a70fff6 100644
--- a/internal/service/question_common/question.go
+++ b/internal/service/question_common/question.go
@@ -384,6 +384,7 @@ func (qs *QuestionCommon) FormatQuestionsPage(
LastAnswerID: questionInfo.LastAnswerID,
Pin: questionInfo.Pin,
Show: questionInfo.Show,
+ Operator: &schema.QuestionPageRespOperator{ID: questionInfo.UserID},
}
questionIDs = append(questionIDs, questionInfo.ID)