Commit 016f3273 authored by Pithon Kabiro's avatar Pithon Kabiro
Browse files

New function: create datastream URL

parent 0ed38717
...@@ -81,6 +81,12 @@ export const getDatastreamIdFromBuildingNumber = function ( ...@@ -81,6 +81,12 @@ export const getDatastreamIdFromBuildingNumber = function (
return datastreamIdMatched; return datastreamIdMatched;
}; };
const getDatastreamUrl = function (baseUrl, datastreamID) {
if (!datastreamID) return;
const fullDatastreamURL = `${baseUrl}/Datastreams(${datastreamID})`;
return fullDatastreamURL;
};
/** /**
* Create URL to fetch the Observations corresponding to a provided Datastream * Create URL to fetch the Observations corresponding to a provided Datastream
* @param {String} baseUrl Base URL of the STA server * @param {String} baseUrl Base URL of the STA server
...@@ -89,8 +95,8 @@ export const getDatastreamIdFromBuildingNumber = function ( ...@@ -89,8 +95,8 @@ export const getDatastreamIdFromBuildingNumber = function (
*/ */
export const getObservationsUrl = function (baseUrl, datastreamID) { export const getObservationsUrl = function (baseUrl, datastreamID) {
if (!datastreamID) return; if (!datastreamID) return;
const fullDatastreamURL = `${baseUrl}/Datastreams(${datastreamID})/Observations`; const fullObservationsURL = `${baseUrl}/Datastreams(${datastreamID})/Observations`;
return fullDatastreamURL; return fullObservationsURL;
}; };
/** /**
......
Supports Markdown
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