fix: Update map with tables fixes

This commit is contained in:
2025-07-09 18:56:18 +03:00
parent 78800ee2ae
commit e2547cb571
87 changed files with 5392 additions and 1410 deletions

View File

@ -55,7 +55,7 @@ class MapStore {
getRoutes = async () => {
const response = await languageInstance("ru").get("/route");
console.log(response.data);
const routesIds = response.data.map((route: any) => route.id);
for (const id of routesIds) {
const route = await languageInstance("ru").get(`/route/${id}`);
@ -116,7 +116,6 @@ class MapStore {
const updatedStations: any[] = [];
const parsedJSON = JSON.parse(json);
console.log("Данные для сохранения (GeoJSON):", parsedJSON);
for (const feature of parsedJSON.features) {
const { geometry, properties, id } = feature;
@ -211,13 +210,6 @@ class MapStore {
const requests: Promise<any>[] = [];
console.log(
`К созданию: ${newStations.length} станций, ${newRoutes.length} маршрутов, ${newSights.length} достопримечательностей.`
);
console.log(
`К обновлению: ${updatedStations.length} станций, ${updatedRoutes.length} маршрутов, ${updatedSights.length} достопримечательностей.`
);
newStations.forEach((data) =>
requests.push(languageInstance("ru").post("/station", data))
);
@ -239,13 +231,11 @@ class MapStore {
);
if (requests.length === 0) {
console.log("Нет изменений для сохранения.");
return;
}
try {
await Promise.all(requests);
console.log("Все изменения успешно сохранены!");
await Promise.all([
this.getRoutes(),