Skip to content

Commit

Permalink
fix: use matched user instead
Browse files Browse the repository at this point in the history
  • Loading branch information
tituschewxj committed Nov 13, 2024
1 parent 6e57576 commit e110913
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/matching-service/processes/findmatches.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func foundMatch(tx *redis.Tx, ctx context.Context, currentUser *models.MatchRequ
}

var matchedTopics []string
if len(currentUser.Topics) == 0 || len(currentUser.Topics) == 0 {
if len(currentUser.Topics) == 0 || len(matchedUser.Topics) == 0 {
// Ensure that matchedTopics will not be empty unless both users are empty
for _, topic := range currentUser.Topics {
matchedTopics = append(matchedTopics, topic)
Expand All @@ -92,7 +92,7 @@ func foundMatch(tx *redis.Tx, ctx context.Context, currentUser *models.MatchRequ
}
}
var matchedDifficulties []string
if len(currentUser.Difficulties) == 0 || len(currentUser.Difficulties) == 0 {
if len(currentUser.Difficulties) == 0 || len(matchedUser.Difficulties) == 0 {
// Ensure that matchedDifficulties will not be empty unless both users are empty
for _, diff := range currentUser.Difficulties {
matchedDifficulties = append(matchedDifficulties, diff)
Expand Down

0 comments on commit e110913

Please sign in to comment.