fix navigation elements
This commit is contained in:
@@ -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}`, 'Ошибка');
|
||||
|
||||
Reference in New Issue
Block a user