Hi,
I a trying to call an api from the front end but i dont get the expected result.
This is frontend
<div class="grid grid-container--fluid btn-toolbar">
<div class="column-md-6" v-for="sensor in sensorData">
<div class="column-md-6" v-if="getCurrentData(sensor.app_id_aqi)">
<div v-for="data in currentData">
{%data%}
</div>
</div>
Javascript method
getCurrentData(apiID) {
console.log("apiid", apiID)
axios.get("api/getCurrentData/"+apiID).then((response) => {
this.currentData = response.data;
console.log("currentData", this.currentData)
}).catch(error => {
console.log(error);
console.log(error.response.data);
console.log(error.response.headers)
});
},
HTTP request node for API call
[{"id":"d8226eb44f302e20","type":"http in","z":"e3b2a296f968effa","name":"","url":"/api/getCurrentData/:apiID","method":"get","upload":false,"swaggerDoc":"","x":170,"y":700,"wires":[["4a88ebf475955c77","2af5585dec07c33b"]]},{"id":"2af5585dec07c33b","type":"http request","z":"e3b2a296f968effa","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"https://data.sensor.community/airrohr/v1/sensor/{apiID}/","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"credentials":{},"x":410,"y":680,"wires":[["644a880fdd5c82a6"]]},{"id":"644a880fdd5c82a6","type":"debug","z":"e3b2a296f968effa","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":570,"y":700,"wires":[]}]
When i do a normal get method like https://data.sensor.community/airrohr/v1/sensor/72267/ i get the response but when i am passing th apiid from the method, it doesnt work and i get below response
Can anyone help here please