mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix escape (#927)
This commit is contained in:
parent
e993114f51
commit
fdcf72b067
@ -48,7 +48,7 @@ function getSortType(sortParam: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function escapeESReservedChars(text: string): string {
|
export function escapeESReservedChars(text: string): string {
|
||||||
return text.replace(/([!*+\-=<>&|()\\[\]{}^~?:\\/"])/g, '\\$1')
|
return text?.replace(/([!*+\-=<>&|()\\[\]{}^~?:\\/"])/g, '\\$1')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getSearchQuery(
|
export function getSearchQuery(
|
||||||
@ -64,8 +64,9 @@ export function getSearchQuery(
|
|||||||
serviceType?: string,
|
serviceType?: string,
|
||||||
accessType?: string
|
accessType?: string
|
||||||
): any {
|
): any {
|
||||||
const emptySearchTerm = text === undefined || text === ''
|
|
||||||
text = escapeESReservedChars(text)
|
text = escapeESReservedChars(text)
|
||||||
|
const emptySearchTerm = text === undefined || text === ''
|
||||||
|
|
||||||
let searchTerm = owner
|
let searchTerm = owner
|
||||||
? `(publicKey.owner:${owner})`
|
? `(publicKey.owner:${owner})`
|
||||||
: tags
|
: tags
|
||||||
|
Loading…
Reference in New Issue
Block a user