From 7a2bb610debc6745b3207b42e381a657cac55f21 Mon Sep 17 00:00:00 2001 From: ychung-mot Date: Thu, 28 Nov 2024 08:09:40 -0800 Subject: [PATCH] chore: fix host search --- server/StrDss.Data/Repositories/RentalListingRepository.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/StrDss.Data/Repositories/RentalListingRepository.cs b/server/StrDss.Data/Repositories/RentalListingRepository.cs index 350db0c5..b76a49f9 100644 --- a/server/StrDss.Data/Repositories/RentalListingRepository.cs +++ b/server/StrDss.Data/Repositories/RentalListingRepository.cs @@ -198,7 +198,7 @@ private static void ApplyFilters(string? all, string? address, string? url, stri (x.PlatformListingUrl != null && x.PlatformListingUrl.ToLower().Contains(allLower)) || (x.PlatformListingNo != null && x.PlatformListingNo.ToLower().Contains(allLower)) || (x.ListingContactNamesTxt != null && x.ListingContactNamesTxt.ToLower().Contains(allLower)) || - (x.BusinessLicenceNo != null && x.BusinessLicenceNo.ToLower().Contains(allLower))); + (x.EffectiveBusinessLicenceNo != null && x.EffectiveBusinessLicenceNo.StartsWith(CommonUtils.SanitizeAndUppercaseString(all)))); } if (address != null && address.IsNotEmpty()) @@ -221,8 +221,8 @@ private static void ApplyFilters(string? all, string? address, string? url, stri if (hostName != null && hostName.IsNotEmpty()) { - var effectiveHostNm = CommonUtils.SanitizeAndUppercaseString(hostName); - query = query.Where(x => x.EffectiveHostNm != null && x.EffectiveHostNm.StartsWith(effectiveHostNm)); + var hostNameLower = hostName.ToLower(); + query = query.Where(x => x.ListingContactNamesTxt != null && x.ListingContactNamesTxt.ToLower().Contains(hostNameLower)); } if (businessLicence != null && businessLicence.IsNotEmpty())