fix: splits controller en service beter op met querries
This commit is contained in:
parent
6bf4193da9
commit
308661d72b
2 changed files with 36 additions and 93 deletions
|
@ -44,3 +44,15 @@ export async function fetchLearningPaths(
|
|||
data: learningPaths,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export async function searchLearningPaths(
|
||||
query: string,
|
||||
language: string
|
||||
): Promise<LearningPath[]> {
|
||||
const apiUrl = `${DWENGO_API_BASE}/learningPath/search`;
|
||||
const params = { all: query, language };
|
||||
|
||||
const searchResults = await fetchWithLogging<LearningPath[]>(apiUrl, `Search learning paths with query "${query}"`, params);
|
||||
return searchResults ?? [];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue