From f2e906e79062a2e414f2a97b8ea1829fdc4d5f63 Mon Sep 17 00:00:00 2001 From: Bogdan Fazakas Date: Mon, 1 Mar 2021 15:35:29 +0200 Subject: [PATCH] Fix/ Search query with price filter and no text (#408) * fixed querry with price filter and no text entered * retrigger checks --- src/components/templates/Search/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/templates/Search/utils.ts b/src/components/templates/Search/utils.ts index 914000913..641b7189a 100644 --- a/src/components/templates/Search/utils.ts +++ b/src/components/templates/Search/utils.ts @@ -33,9 +33,9 @@ type FilterByPriceOptions = typeof FilterByPriceOptions[keyof typeof FilterByPri function addPriceFilterToQuerry(sortTerm: string, priceFilter: string): string { sortTerm = priceFilter - ? sortTerm === '' - ? `price.type:${priceFilter}` - : `${sortTerm} AND price.type:${priceFilter}` + ? /\S/.test(sortTerm) + ? `${sortTerm} AND price.type:${priceFilter}` + : `price.type:${priceFilter}` : sortTerm return sortTerm }