Исправлена передача maxCards в тестах, версия 3.14.9
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 47s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 47s
This commit is contained in:
@@ -36,16 +36,34 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry
|
||||
|
||||
const handleCheckmarkClick = async (task, e) => {
|
||||
e.stopPropagation()
|
||||
|
||||
|
||||
// Для задач-тестов запускаем тест вместо открытия модального окна
|
||||
const isTest = task.config_id != null
|
||||
if (isTest) {
|
||||
if (task.config_id) {
|
||||
onNavigate?.('test', { configId: task.config_id, taskId: task.id })
|
||||
try {
|
||||
// Загружаем детальную информацию о задаче, чтобы получить maxCards
|
||||
const response = await authFetch(`${API_URL}/${task.id}`)
|
||||
if (!response.ok) {
|
||||
throw new Error('Ошибка при загрузке деталей задачи')
|
||||
}
|
||||
const taskDetail = await response.json()
|
||||
|
||||
// Переходим к тесту с maxCards
|
||||
onNavigate?.('test', {
|
||||
configId: task.config_id,
|
||||
taskId: task.id,
|
||||
maxCards: taskDetail.max_cards
|
||||
})
|
||||
} catch (err) {
|
||||
console.error('Failed to load task details:', err)
|
||||
// В случае ошибки всё равно переходим к тесту, но без maxCards
|
||||
onNavigate?.('test', { configId: task.config_id, taskId: task.id })
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// Для обычных задач открываем диалог подтверждения
|
||||
setSelectedTaskForDetail(task.id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user