1
0

Добавление логики

1. Получения конфигурациия с бека
2. Время закрытия задачи
3. Изменение фронта под новую локигу конфигурации
4. Обновление структуры бд
This commit is contained in:
2026-01-13 09:11:56 +07:00
parent 7449b46091
commit 2d27abc48a
11 changed files with 157 additions and 53 deletions

View File

@@ -124,4 +124,26 @@ export const taskImageApi = {
// ==================== USERS ====================
export const usersApi = {
getAll: () => request('/api/user', { credentials: 'include' })
}
// ==================== CONFIG ====================
export const configApi = {
get: () => request('/api/user', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ action: 'get_config' })
})
}
// Загрузка конфига с сервера и мерж с window.APP_CONFIG
export const loadServerConfig = async () => {
try {
const result = await configApi.get()
if (result.success && result.data) {
window.APP_CONFIG = { ...window.APP_CONFIG, ...result.data }
}
} catch (error) {
console.error('Ошибка загрузки конфига:', error)
}
}