fix(backend): Undid accidental rename of LearningPath to LearningContent.

This commit is contained in:
Gerald Schmittinger 2025-03-03 22:25:00 +01:00
parent e660c185b5
commit 770c5c9879
3 changed files with 9 additions and 9 deletions

View file

@ -1,9 +1,9 @@
import { fetchWithLogging } from '../../../util/apiHelper.js'; import { fetchWithLogging } from '../../../util/apiHelper.js';
import { DWENGO_API_BASE } from '../../../config.js'; import { DWENGO_API_BASE } from '../../../config.js';
import { import {
LearningContent, LearningPath,
LearningPathResponse, LearningPathResponse,
} from '../../../interfaces/learningContent.js'; } from '../../../interfaces/learning-content.js';
import {LearningPathProvider} from "../learning-path-provider"; import {LearningPathProvider} from "../learning-path-provider";
const dwengoApiLearningPathProvider: LearningPathProvider = { const dwengoApiLearningPathProvider: LearningPathProvider = {
@ -24,7 +24,7 @@ const dwengoApiLearningPathProvider: LearningPathProvider = {
const apiUrl = `${DWENGO_API_BASE}/learningPath/getPathsFromIdList`; const apiUrl = `${DWENGO_API_BASE}/learningPath/getPathsFromIdList`;
const params = { pathIdList: JSON.stringify({ hruids }), language }; const params = { pathIdList: JSON.stringify({ hruids }), language };
const learningPaths = await fetchWithLogging<LearningContent[]>( const learningPaths = await fetchWithLogging<LearningPath[]>(
apiUrl, apiUrl,
`Learning paths for ${source}`, `Learning paths for ${source}`,
params params
@ -49,11 +49,11 @@ const dwengoApiLearningPathProvider: LearningPathProvider = {
async searchLearningPaths( async searchLearningPaths(
query: string, query: string,
language: string language: string
): Promise<LearningContent[]> { ): Promise<LearningPath[]> {
const apiUrl = `${DWENGO_API_BASE}/learningPath/search`; const apiUrl = `${DWENGO_API_BASE}/learningPath/search`;
const params = { all: query, language }; const params = { all: query, language };
const searchResults = await fetchWithLogging<LearningContent[]>( const searchResults = await fetchWithLogging<LearningPath[]>(
apiUrl, apiUrl,
`Search learning paths with query "${query}"`, `Search learning paths with query "${query}"`,
params params

View file

@ -1,4 +1,4 @@
import {LearningContent, LearningPathResponse} from "../../interfaces/learningContent"; import {LearningPath, LearningPathResponse} from "../../interfaces/learning-content";
/** /**
* Generic interface for a service which provides access to learning paths from a data source. * Generic interface for a service which provides access to learning paths from a data source.
@ -12,5 +12,5 @@ export interface LearningPathProvider {
/** /**
* Search learning paths in the data source using the given search string. * Search learning paths in the data source using the given search string.
*/ */
searchLearningPaths(query: string, language: string): Promise<LearningContent[]>; searchLearningPaths(query: string, language: string): Promise<LearningPath[]>;
} }

View file

@ -1,4 +1,4 @@
import {LearningContent, LearningPathResponse} from "../../interfaces/learningContent"; import {LearningPath, LearningPathResponse} from "../../interfaces/learning-content";
import dwengoApiLearningPathProvider from "./dwengo-api/dwengo-api-learning-path-provider"; import dwengoApiLearningPathProvider from "./dwengo-api/dwengo-api-learning-path-provider";
/** /**
@ -15,7 +15,7 @@ const learningPathService = {
/** /**
* Search learning paths in the data source using the given search string. * Search learning paths in the data source using the given search string.
*/ */
searchLearningPaths(query: string, language: string): Promise<LearningContent[]> { searchLearningPaths(query: string, language: string): Promise<LearningPath[]> {
return dwengoApiLearningPathProvider.searchLearningPaths(query, language); return dwengoApiLearningPathProvider.searchLearningPaths(query, language);
} }
} }