Add owner work order approval page
Some checks failed
ci / test (push) Has been cancelled

This commit is contained in:
VPN SaaS Dev
2026-05-16 10:51:05 +09:00
parent ac5845d5a0
commit 545f4d088d
12 changed files with 1066 additions and 48 deletions

View File

@@ -2280,6 +2280,22 @@ async function loadCars() {
}
}
async function applyInitialRoute() {
const params = new URLSearchParams(window.location.search);
const section = params.get("section");
const carId = Number(params.get("car_id") || 0);
if (carId && state.cars.some((car) => car.id === carId)) {
state.selectedCarId = carId;
renderCars();
fillCarProfileForm();
await loadSelectedCar();
}
if (section === "carProfile") {
await openDrawerSection("carProfileSection");
window.history.replaceState({}, "", window.location.pathname);
}
}
async function selectCar(carId) {
state.selectedCarId = carId;
renderCars();
@@ -2841,7 +2857,8 @@ Promise.all([loadAuthConfig()])
initCarCatalog();
return Promise.all([loadMyServiceCenters().catch(() => []), loadCars()]);
})
.then(() => applyInitialRoute())
.catch((error) => {
if (error.message === "Требуется вход через Telegram") return;
document.body.insertAdjacentHTML("afterbegin", `<div class="error">${error.message}</div>`);
});
});