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 {
|
||||
return text.replace(/([!*+\-=<>&|()\\[\]{}^~?:\\/"])/g, '\\$1')
|
||||
return text?.replace(/([!*+\-=<>&|()\\[\]{}^~?:\\/"])/g, '\\$1')
|
||||
}
|
||||
|
||||
export function getSearchQuery(
|
||||
@ -64,8 +64,9 @@ export function getSearchQuery(
|
||||
serviceType?: string,
|
||||
accessType?: string
|
||||
): any {
|
||||
const emptySearchTerm = text === undefined || text === ''
|
||||
text = escapeESReservedChars(text)
|
||||
const emptySearchTerm = text === undefined || text === ''
|
||||
|
||||
let searchTerm = owner
|
||||
? `(publicKey.owner:${owner})`
|
||||
: tags
|
||||
|
Loading…
Reference in New Issue
Block a user