From b0611b9f7fcc3b3271de469b1934808312362b0d Mon Sep 17 00:00:00 2001 From: Lars Date: Fri, 22 May 2026 22:46:00 +0200 Subject: [PATCH] Update ExercisePickerModal to Enforce Backend Suggestion Limit - 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. --- frontend/src/components/ExercisePickerModal.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/ExercisePickerModal.jsx b/frontend/src/components/ExercisePickerModal.jsx index e5a7518..65f849e 100644 --- a/frontend/src/components/ExercisePickerModal.jsx +++ b/frontend/src/components/ExercisePickerModal.jsx @@ -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, }