feat: Fixed path for routes

This commit is contained in:
2025-06-09 14:07:51 +03:00
parent 64c15b2622
commit 2ca1f2cba4
13 changed files with 706 additions and 32 deletions

View File

@ -34,13 +34,27 @@ class MapStore {
getRoutes = async () => {
const routes = await languageInstance("ru").get("/route");
const mappedRoutes = routes.data.map((route: any) => ({
id: route.id,
route_number: route.route_number,
path: route.path,
}));
const routedIds = routes.data.map((route: any) => route.id);
this.routes = mappedRoutes;
const mappedRoutes: ApiRoute[] = [];
for (const routeId of routedIds) {
const responseSoloRoute = await languageInstance("ru").get(
`/route/${routeId}`
);
const route = responseSoloRoute.data;
const mappedRoute = {
id: route.id,
route_number: route.route_number,
path: route.path,
};
mappedRoutes.push(mappedRoute);
}
this.routes = mappedRoutes.sort((a, b) =>
a.route_number.localeCompare(b.route_number)
);
};
getStations = async () => {