1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Fix/ Search query with price filter and no text (#408)

* fixed querry with price filter and no text entered

* retrigger checks
This commit is contained in:
Bogdan Fazakas 2021-03-01 15:35:29 +02:00 committed by GitHub
parent 433af0147a
commit f2e906e790
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}