♻️ Fix /stop/ endpoints inconsistency

This commit is contained in:
2023-05-08 13:44:44 +02:00
parent 93047c8706
commit d15fee75ca
2 changed files with 5 additions and 7 deletions

View File

@@ -93,7 +93,7 @@ export function BusinessDataProvider(props: { children: JSX.Element }) {
const refreshPassages = async (stopId: number): Promise<void> => {
const httpOptions = { headers: { "Content-Type": "application/json" } };
console.log(`Fetching data for ${stopId}`);
const data = await fetch(`${serverUrl()}/stop/nextPassages/${stopId}`, httpOptions);
const data = await fetch(`${serverUrl()}/stop/${stopId}/nextPassages`, httpOptions);
const response = await data.json();
_cleanupPassages(response.passages);
addPassages(response.passages);
@@ -183,7 +183,7 @@ ${linePassagesDestination.length} here... refresh all them.`);
let shape = store.stopShapes[stopId];
if (shape === undefined) {
console.log(`No shape found for ${stopId} stop... fetch it from backend.`);
const data = await fetch(`${serverUrl()}/stop_shape/${stopId}`, {
const data = await fetch(`${serverUrl()}/stop/${stopId}/shape`, {
headers: { 'Content-Type': 'application/json' }
});
shape = await data.json();