feat(backend): databaseLearningPathProvider.searchLearningPaths geïmplementeerd.
This commit is contained in:
parent
34af354a33
commit
4d999c78ba
2 changed files with 26 additions and 2 deletions
|
@ -157,8 +157,13 @@ const databaseLearningPathProvider: LearningPathProvider = {
|
|||
/**
|
||||
* Search learning paths in the database using the given search string.
|
||||
*/
|
||||
searchLearningPaths(query: string, language: string): Promise<LearningPath[]> {
|
||||
return Promise.resolve([]); // TODO
|
||||
async searchLearningPaths(query: string, language: Language): Promise<LearningPath[]> {
|
||||
const searchResults = await learningPathRepo.findByQueryStringAndLanguage(query, language);
|
||||
return await Promise.all(
|
||||
searchResults.map((result, index) =>
|
||||
convertLearningPath(result, index)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue