Merge branch 'dev' into refactor/common

This commit is contained in:
Tibo De Peuter 2025-04-01 21:38:50 +02:00
commit a4408b5bc0
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
145 changed files with 3437 additions and 2822 deletions

View file

@ -7,6 +7,7 @@ import {
LearningObjectNode,
LearningPathResponse,
} from 'dwengo-1-common/src/interfaces/learning-content';
import { getLogger } from '../logging/initalize.js';
function filterData(data: LearningObjectMetadata, htmlUrl: string): FilteredLearningObject {
return {
@ -43,7 +44,7 @@ export async function getLearningObjectById(hruid: string, language: string): Pr
);
if (!metadata) {
console.error(`⚠️ WARNING: Learning object "${hruid}" not found.`);
getLogger().error(`⚠️ WARNING: Learning object "${hruid}" not found.`);
return null;
}
@ -54,7 +55,7 @@ export async function getLearningObjectById(hruid: string, language: string): Pr
/**
* Generic function to fetch learning paths
*/
function fetchLearningPaths(arg0: string[], language: string, arg2: string): LearningPathResponse | PromiseLike<LearningPathResponse> {
function fetchLearningPaths(_arg0: string[], _language: string, _arg2: string): LearningPathResponse | PromiseLike<LearningPathResponse> {
throw new Error('Function not implemented.');
}
@ -66,7 +67,7 @@ async function fetchLearningObjects(hruid: string, full: boolean, language: stri
const learningPathResponse: LearningPathResponse = await fetchLearningPaths([hruid], language, `Learning path for HRUID "${hruid}"`);
if (!learningPathResponse.success || !learningPathResponse.data?.length) {
console.error(`⚠️ WARNING: Learning path "${hruid}" exists but contains no learning objects.`);
getLogger().error(`⚠️ WARNING: Learning path "${hruid}" exists but contains no learning objects.`);
return [];
}
@ -80,7 +81,7 @@ async function fetchLearningObjects(hruid: string, full: boolean, language: stri
objects.filter((obj): obj is FilteredLearningObject => obj !== null)
);
} catch (error) {
console.error('❌ Error fetching learning objects:', error);
getLogger().error('❌ Error fetching learning objects:', error);
return [];
}
}