Skip to content

Commit

Permalink
Merge branch 'fix/1.2.1/user' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkinStars committed Dec 7, 2023
2 parents 7d28759 + f0ebcaf commit 6f55ff7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions internal/repo/activity/answer_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,7 @@ func (ar *AnswerActivityRepo) sendAcceptAnswerNotification(
ReceiverUserID: act.ActivityUserID,
TriggerUserID: act.TriggerUserID,
}
if act.ActivityUserID == op.QuestionUserID {
msg.ObjectType = constant.AnswerObjectType
} else {
msg.ObjectType = constant.AnswerObjectType
}
msg.ObjectType = constant.AnswerObjectType
if msg.TriggerUserID != msg.ReceiverUserID {
ar.notificationQueueService.Send(ctx, msg)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/service/user_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ func (us *UserService) warpStatRankingResp(
if stat.Rank <= 0 {
continue
}
if userInfo := userInfoMapping[stat.UserID]; userInfo != nil {
if userInfo := userInfoMapping[stat.UserID]; userInfo != nil && userInfo.Status != entity.UserStatusDeleted {
resp.UsersWithTheMostReputation = append(resp.UsersWithTheMostReputation, &schema.UserRankingSimpleInfo{
Username: userInfo.Username,
Rank: stat.Rank,
Expand All @@ -890,7 +890,7 @@ func (us *UserService) warpStatRankingResp(
if stat.VoteCount <= 0 {
continue
}
if userInfo := userInfoMapping[stat.UserID]; userInfo != nil {
if userInfo := userInfoMapping[stat.UserID]; userInfo != nil && userInfo.Status != entity.UserStatusDeleted {
resp.UsersWithTheMostVote = append(resp.UsersWithTheMostVote, &schema.UserRankingSimpleInfo{
Username: userInfo.Username,
VoteCount: stat.VoteCount,
Expand All @@ -900,7 +900,7 @@ func (us *UserService) warpStatRankingResp(
}
}
for _, rel := range userRoleRels {
if userInfo := userInfoMapping[rel.UserID]; userInfo != nil {
if userInfo := userInfoMapping[rel.UserID]; userInfo != nil && userInfo.Status != entity.UserStatusDeleted {
resp.Staffs = append(resp.Staffs, &schema.UserRankingSimpleInfo{
Username: userInfo.Username,
Rank: userInfo.Rank,
Expand Down

0 comments on commit 6f55ff7

Please sign in to comment.