From e1109139d448e6c8f80aa5e615d3fb9f3cdb15e8 Mon Sep 17 00:00:00 2001 From: tituschewxj Date: Thu, 14 Nov 2024 07:09:22 +0800 Subject: [PATCH] fix: use matched user instead --- apps/matching-service/processes/findmatches.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/matching-service/processes/findmatches.go b/apps/matching-service/processes/findmatches.go index b74bf6801d..c43a8d98eb 100644 --- a/apps/matching-service/processes/findmatches.go +++ b/apps/matching-service/processes/findmatches.go @@ -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) @@ -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)