diff --git a/src/components/sidebar/buttons.tsx b/src/components/sidebar/buttons.tsx index 0d0675f..a7c2f12 100644 --- a/src/components/sidebar/buttons.tsx +++ b/src/components/sidebar/buttons.tsx @@ -11,10 +11,10 @@ import React, { FC } from "react"; import { Button } from "react-bulma-components"; import { useTranslation } from "react-i18next"; import { useAppContext } from "~/appContext"; +import { fetchNodeDataFromBackend } from "~/backend"; import { OSM_DOMAIN } from "~/constants"; import { ModalType, initialModalState } from "~/model/modal"; import SidebarAction from "~/model/sidebarAction"; -import { fetchNodeDataFromOsm } from "~/osm"; type OsmId = string; @@ -27,7 +27,7 @@ export function EditButton({ osmId }: { osmId: OsmId }) { authState: { auth }, } = useAppContext(); const startEdit = () => { - fetchNodeDataFromOsm(osmId).then((data) => { + fetchNodeDataFromBackend(osmId).then((data) => { setSidebarData(data); if (auth === null || !auth.authenticated()) { setModalState({ diff --git a/src/osm.ts b/src/osm.ts index 25623a6..4de50ed 100644 --- a/src/osm.ts +++ b/src/osm.ts @@ -36,19 +36,6 @@ export async function fetchNodeData( }); } -export async function fetchNodeDataFromOsm( - nodeId: string, -): Promise { - const url = `https://api.openstreetmap.org/api/0.6/node/${nodeId}.json`; - console.log( - "Request object info for node with osm id:", - nodeId, - " via url: ", - url, - ); - return fetchNodeData(url); -} - export function updateOsmUsernameState( auth: OSMAuth.osmAuth, setOsmUsername: (username: string) => void,