country filter fix

This commit is contained in:
Mazyar
2026-05-23 21:14:21 +03:30
parent 68e188a3e8
commit 6a74b34809
+7 -1
View File
@@ -1071,7 +1071,13 @@ func (r *tenderRepository) buildSearchFilter(form *SearchForm) bson.M {
if and, ok := filter["$and"].([]bson.M); ok {
filter["$and"] = append(and, scrapedClause)
} else {
filter["$and"] = []bson.M{filter, scrapedClause}
existing := bson.M{}
for k, v := range filter {
existing[k] = v
}
filter = bson.M{
"$and": []bson.M{existing, scrapedClause},
}
}
}