This commit is contained in:
Gerald Schmittinger 2025-05-14 23:37:06 +02:00
commit ebc4c16c89
7 changed files with 67 additions and 15 deletions

View file

@ -30,12 +30,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)),
});
}