Skip to content

Commit

Permalink
Remove fetchNodeDataFromBackend TODOs
Browse files Browse the repository at this point in the history
I decided to keep fetchNodeDataFromOsm.
The case is editing AED multiple times in quick succession.
OpenAEDMap could be lagging behind compared to OSM.
Even if it's one minute of delay it's bad UX.

Fixes #207
  • Loading branch information
starsep committed Feb 14, 2024
1 parent 6e92a02 commit 2566834
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/osm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {

// Example: UTC+01:00 -> 60
function parseTimezoneOffset(timezoneOffset: string | undefined): number {
// TODO: remove check after fetching data from backend
if (timezoneOffset === undefined) return 0;
const sign = timezoneOffset[3] === "+" ? 1 : -1;
const hours = parseInt(timezoneOffset.slice(4, 6), 10);
Expand All @@ -20,6 +19,7 @@ export async function fetchNodeData(
.then((response) => response.json())
.then((response) => {
const node = response.elements[0];
// Note: data here can be either from OSM or from the backend
return {
osmId: node.id,
osmType: "node",
Expand All @@ -38,7 +38,6 @@ export async function fetchNodeData(
});
}

// TODO: remove after fixing https://github.com/openstreetmap-polska/openaedmap-backend/issues/53
export async function fetchNodeDataFromOsm(
nodeId: string,
): Promise<DefibrillatorData | null> {
Expand Down

0 comments on commit 2566834

Please sign in to comment.