I'm in trouble to use variables in an Axios request to a Loopback(v3) API.
What works? If I use the "REST notation" it works well:
getInfo() {
axios.get('http://myIp/api/tabs?filter[where][name]=' + this.name).then(response => {
this.tabs = response.data
})
What doesn't work yet:
I can't translate the "REST notation" to the "Node notation" that I would prefer to use here.
What I tried already:
axios.get('http://myIp/api/tabs?filter={"where":{"name": this.name }}).then(response => {
this.tabs = response.data
})
I realise that with single quotes around the whole request, I can't get variable interpolation. But if I use double quotes, I don't know how to escape the ones used for the reserved words like "where", ...
What would be the correct way to use variables in this context?