From d71299ba90a7bd402616fe2d6024932321b40827 Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Mon, 24 Apr 2023 10:51:58 -0400 Subject: [PATCH] don't need it --- lightning/src/lib/fetchStations.tsx | 67 ----------------------------- 1 file changed, 67 deletions(-) delete mode 100644 lightning/src/lib/fetchStations.tsx diff --git a/lightning/src/lib/fetchStations.tsx b/lightning/src/lib/fetchStations.tsx deleted file mode 100644 index c721670..0000000 --- a/lightning/src/lib/fetchStations.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { createSignal } from "solid-js"; - -import { scatData, setScatData } from "~/root"; - -type ChargingStation = { - Name: string - PhoneNumer: string - IntersectionDirections: string - AccessTime: string - Connectors: string[] - Network: string - Pricing: string - RestrictedAccess: boolean - CntLevel2Chargers: number - CntLevel3Chargers: number -}; - -type Location = { - StreetAddress: string - City: string - State: string - Country: string - Zip: string - GeocodeStatus: string - Coordinates: string - CoordinateString: string - Stations: ChargingStation[] -}; - -type StationRequest = { - Latitude: number - Longitude: number - Distance: number - CountLimit: number -}; - -type StationResponse = { - Dist: number - Loc: Location -}; - -const TEST_PACKET: StationRequest = { - Latitude: 42.36, - Longitude: -71.05625, - Distance: 10, - CountLimit: 10, -}; - -export const [stationsRequest, setStationsRequest] = createSignal(TEST_PACKET) - -export async function fetchStations() { - let response = await fetch('https://kevinfwu.com/getnearest', { - method: 'POST', - cache: 'default', - body: JSON.stringify(stationsRequest()), - headers: { 'Content-Type': 'application/json' } - }); - let resJson = await response.json(); - let buf = []; - for (let station of resJson) { - buf.push({coordinates: [station.Loc.Coordinates[1], station.Loc.Coordinates[0]]}) - }; - setScatData(buf); - - //console.log(getCoords(resJson)); - return resJson as StationResponse[]; -};