feat: refine exercise focus area retrieval in training planning
Deploy Development / deploy (push) Successful in 36s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Failing after 1m56s

- Updated the SQL query in the training planning module to fetch the primary exercise focus area more efficiently.
- Enhanced error handling in the API utility to provide clearer feedback on potential issues, including CORS and URL errors, improving debugging for developers.
This commit is contained in:
Lars committed 2026-04-29 06:33:23 +02:00
1 parent 131b7d591d
commit 23d4281058
2 files changed
+10 -2

No files matched your search

+7 -1
View File
@@ -117,7 +117,13 @@ def _fetch_sections(cur, unit_id: int) -> List[Dict[str, Any]]:
SELECT tusi.*,
e.title AS exercise_title,
e.summary AS exercise_summary,
e.focus_area AS exercise_focus_area,
(
SELECT fa.name FROM exercise_focus_areas efa
JOIN focus_areas fa ON fa.id = efa.focus_area_id
WHERE efa.exercise_id = e.id
ORDER BY efa.is_primary DESC NULLS LAST, fa.name ASC
LIMIT 1
) AS exercise_focus_area,
ev.variant_name AS exercise_variant_name
FROM training_unit_section_items tusi
LEFT JOIN exercises e ON tusi.exercise_id = e.id