Update ExercisePickerModal to Enforce Backend Suggestion Limit
All checks were successful
Deploy Development / deploy (push) Successful in 42s
Test Suite / pytest-backend (push) Successful in 39s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m17s

- Introduced a constant `PLANNING_SUGGEST_LIMIT` set to 50 to align with backend constraints for exercise suggestions.
- Updated the API request limit in `ExercisePickerModal` to utilize the new constant, ensuring compliance with backend specifications.
This commit is contained in:
Lars 2026-05-22 22:46:00 +02:00
parent 614c2dcfaa
commit b0611b9f7f

View File

@ -27,6 +27,8 @@ import {
} from '../utils/exerciseAiQuickCreate'
const PAGE_SIZE = 100
/** Backend POST /api/planning/exercise-suggest erlaubt max. 50 */
const PLANNING_SUGGEST_LIMIT = 50
const LEVEL_FILTER_OPTS = SKILL_LEVEL_OPTIONS.filter((o) => o.level != null)
const INITIAL_FILTERS = { ...INITIAL_EXERCISE_LIST_FILTERS }
@ -358,7 +360,7 @@ export default function ExercisePickerModal({
include_llm_rank: Boolean(query),
query,
intent_hint: activePlanningContext.intentHint || (useFreePlanningSearch && query ? 'free_search' : null),
limit: PAGE_SIZE,
limit: PLANNING_SUGGEST_LIMIT,
exercise_kind_any:
Array.isArray(exerciseKindAny) && exerciseKindAny.length > 0 ? exerciseKindAny : undefined,
}