replace redux with zustand
This commit is contained in:
13
src/api/kvv.ts
Normal file
13
src/api/kvv.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
async function fetchKvvDepartures(stopId: number) {
|
||||
const API_URL = `https://projekte.kvv-efa.de/sl3-alone/XSLT_DM_REQUEST?outputFormat=JSON&coordOutputFormat=WGS84[dd.ddddd]&depType=stopEvents&locationServerActive=1&mode=direct&name_dm=${stopId}&type_dm=stop&useOnlyStops=1&useRealtime=1&limit=6&line=kvv:22301:E:H:s25&line=kvv:21012:E:H:s25&line=kvv:21012:E:R:s25&line=kvv:22305:E:H:s25`;
|
||||
|
||||
const data = await fetch(API_URL, {
|
||||
method: "GET",
|
||||
});
|
||||
if (!data.ok) {
|
||||
throw new Error(`HTTP error! status: ${data.status}`);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
export { fetchKvvDepartures };
|
||||
Reference in New Issue
Block a user