I have this filter:
{ "fields": {"goal":true,"amountPledged": true,"title": true},"where": {"title": {"like":`%${this.state.searchText}%`}} }
The this.state.searchText
has value of bio
.
Which supposedly would be encoded into:
https://website.com/api/table?filter=%7B%20%22fields%22%3A%20%7B%22goal%22%3Atrue%2C%22amountPledged%22%3A%20true%2C%22title%22%3A%20true%7D%2C%22where%22%3A%20%7B%22title%22%3A%20%7B%22like%22%3A%22%25bio%25%22%7D%7D%20%7D
The problem I'm having is the use of %
symbol within my filter. This part :
{"like":`%${this.state.searchText}%`}
So, because of that %
symbol, my actual encoded link is this, thus causing some error in getting data:
http://website.com/api/table??filter={"fields":{"goal":true,"amountPledged":true,"title":true},"where":{"title":{"like":"%bio%"}}}
How can I make the %
symbol to be included & decoded properly?
I'm using Axios to make requests & loopback for my api.