fix navigation elements

This commit is contained in:
Primakov Alexandr Alexandrovich
2025-03-12 09:12:09 +03:00
parent b5301f948a
commit f91f821f86
6 changed files with 119 additions and 8 deletions

View File

@@ -431,7 +431,20 @@ $(document).ready(function() {
success: function(result) {
if (result.success) {
showAlert('Опрос успешно удален', 'Удаление опроса', function() {
window.location.href = window.location.pathname.split('/admin')[0];
// Получаем базовый путь с учетом /ms в продакшен-версии
const isMsPath = window.location.pathname.includes('/ms/questioneer');
let basePath;
if (isMsPath) {
// Для продакшна: используем /ms/questioneer
basePath = '/ms/questioneer';
} else {
// Для локальной разработки: используем текущий путь
basePath = window.location.pathname.split('/admin')[0];
}
// Перенаправляем на главную страницу
window.location.href = basePath;
}, true);
} else {
showAlert(`Ошибка при удалении опроса: ${result.error}`, 'Ошибка');