refactor(backend): Changed folder structure for learning content services.
This commit is contained in:
parent
18ee991ce3
commit
cc6947dd3c
8 changed files with 13 additions and 13 deletions
23
backend/src/services/learning-paths/learning-path-service.ts
Normal file
23
backend/src/services/learning-paths/learning-path-service.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import {LearningPath, LearningPathResponse} from "../../interfaces/learning-content";
|
||||
import dwengoApiLearningPathProvider from "./dwengo-api-learning-path-provider";
|
||||
|
||||
/**
|
||||
* Service providing access to data about learning paths from the appropriate data source (database or Dwengo-api)
|
||||
*/
|
||||
const learningPathService = {
|
||||
/**
|
||||
* Fetch the learning paths with the given hruids from the data source.
|
||||
*/
|
||||
fetchLearningPaths(hruids: string[], language: string, source: string): Promise<LearningPathResponse> {
|
||||
return dwengoApiLearningPathProvider.fetchLearningPaths(hruids, language, source);
|
||||
},
|
||||
|
||||
/**
|
||||
* Search learning paths in the data source using the given search string.
|
||||
*/
|
||||
searchLearningPaths(query: string, language: string): Promise<LearningPath[]> {
|
||||
return dwengoApiLearningPathProvider.searchLearningPaths(query, language);
|
||||
}
|
||||
}
|
||||
|
||||
export default learningPathService;
|
Loading…
Add table
Add a link
Reference in a new issue