feat(backend): databaseLearningPathProvider.searchLearningPaths geïmplementeerd.

This commit is contained in:
Gerald Schmittinger 2025-03-08 18:26:10 +01:00
parent 34af354a33
commit 4d999c78ba
2 changed files with 26 additions and 2 deletions

View file

@ -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)
)
);
}
}