feat: enhance exercise filtering and UI components
Deploy Development / deploy (push) Successful in 32s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 5s
Test Suite / playwright-tests (push) Failing after 1m54s

- Introduced multi-select functionality for filtering exercises by focus areas, style directions, training types, target groups, and skills, allowing users to select multiple options.
- Updated the ExercisesListPage to utilize the new multi-select component, improving the user experience for filtering exercises.
- Enhanced backend filtering logic to support new array-based query parameters, ensuring efficient handling of multiple filter criteria.
- Adjusted CSS styles for better layout and usability of the exercise filters.
This commit is contained in:
Lars committed 2026-04-28 08:02:08 +02:00
1 parent 025b161d2f
commit fd2009294b
5 files changed
+433 -90

No files matched your search

+10 -2
View File
@@ -213,9 +213,17 @@ export async function deleteMethod(id) {
export async function listExercises(filters = {}) {
const q = new URLSearchParams()
Object.entries(filters).forEach(([k, v]) => {
if (v !== undefined && v !== null && String(v).trim() !== '') {
q.set(k, String(v))
if (v === undefined || v === null) return
if (Array.isArray(v)) {
if (v.length === 0) return
v.forEach((item) => {
if (item !== '' && item !== undefined && item !== null && String(item).trim() !== '') {
q.append(k, String(item))
}
})
return
}
if (String(v).trim() !== '') q.set(k, String(v))
})
const query = q.toString()
return request(`/api/exercises${query ? '?' + query : ''}`)