fix(frontend): Leerpaden voor thema's opvragen in de juiste taal

This commit is contained in:
Gerald Schmittinger 2025-05-14 09:41:09 +02:00
parent 9e8770cf06
commit a1c9f37081
4 changed files with 10 additions and 8 deletions

View file

@ -22,12 +22,13 @@ export function useGetLearningPathQuery(
});
}
export function useGetAllLearningPathsByThemeQuery(
export function useGetAllLearningPathsByThemeAndLanguageQuery(
theme: MaybeRefOrGetter<string>,
language: MaybeRefOrGetter<Language>
): UseQueryReturnType<LearningPath[], Error> {
return useQuery({
queryKey: [LEARNING_PATH_KEY, "getAllByTheme", theme],
queryFn: async () => learningPathController.getAllByTheme(toValue(theme)),
queryKey: [LEARNING_PATH_KEY, "getAllByTheme", theme, language],
queryFn: async () => learningPathController.getAllByThemeAndLanguage(toValue(theme), toValue(language)),
enabled: () => Boolean(toValue(theme)),
});
}