Fix: Filtros ExplorarPage

This commit is contained in:
2026-03-20 13:39:11 -03:00
parent 8bd8384715
commit f837f446b9
2 changed files with 14 additions and 3 deletions

View File

@@ -79,7 +79,12 @@ public class AdsV2Controller : ControllerBase
query = query.Where(a => a.Transmission == transmission || a.Features.Any(f => f.FeatureKey == "Transmision" && f.FeatureValue == transmission));
if (!string.IsNullOrEmpty(color))
query = query.Where(a => a.Color == color || a.Features.Any(f => f.FeatureKey == "Color" && f.FeatureValue == color));
{
var lowerColor = color.ToLower();
query = query.Where(a =>
(a.Color != null && a.Color.ToLower().Contains(lowerColor)) ||
a.Features.Any(f => f.FeatureKey == "Color" && f.FeatureValue != null && f.FeatureValue.ToLower().Contains(lowerColor)));
}
if (!string.IsNullOrEmpty(Request.Query["segment"]))
{
@@ -88,8 +93,8 @@ public class AdsV2Controller : ControllerBase
}
if (!string.IsNullOrEmpty(Request.Query["location"]))
{
var loc = Request.Query["location"].ToString();
query = query.Where(a => a.Location != null && a.Location.Contains(loc));
var loc = Request.Query["location"].ToString().ToLower();
query = query.Where(a => a.Location != null && a.Location.ToLower().Contains(loc));
}
if (!string.IsNullOrEmpty(Request.Query["condition"]))
{