Commit b5ed37e8 authored by Pithon Kabiro's avatar Pithon Kabiro
Browse files

New function: fetch datastream metadata

parent 016f3273
......@@ -138,6 +138,19 @@ export const axiosGetRequest = function (urlObservations, urlParamObj) {
});
};
const getDatastreamMetadata = async function (urlDatastream) {
try {
// Extract properties of interest
const {
data: { description, name, unitOfMeasurement },
} = await axiosGetRequest(urlDatastream);
return { description, name, unitOfMeasurement };
} catch (err) {
console.log(err);
}
};
/**
* Format the response from SensorThings API to make it suitable for heatmap
* @param {Array} obsArray Response from SensorThings API as array
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment