fix: format

This commit is contained in:
Gabriellvl 2025-03-01 18:42:45 +01:00
parent 5da0720a08
commit 887787de05
8 changed files with 107 additions and 41 deletions

View file

@ -1,6 +1,9 @@
import { fetchWithLogging } from "../util/apiHelper.js";
import { DWENGO_API_BASE } from "../config.js";
import {LearningPath, LearningPathResponse} from "../interfaces/learningPath.js";
import { fetchWithLogging } from '../util/apiHelper.js';
import { DWENGO_API_BASE } from '../config.js';
import {
LearningPath,
LearningPathResponse,
} from '../interfaces/learningPath.js';
export async function fetchLearningPaths(
hruids: string[],
@ -19,7 +22,11 @@ export async function fetchLearningPaths(
const apiUrl = `${DWENGO_API_BASE}/learningPath/getPathsFromIdList`;
const params = { pathIdList: JSON.stringify({ hruids }), language };
const learningPaths = await fetchWithLogging<LearningPath[]>(apiUrl, `Learning paths for ${source}`, params);
const learningPaths = await fetchWithLogging<LearningPath[]>(
apiUrl,
`Learning paths for ${source}`,
params
);
if (!learningPaths || learningPaths.length === 0) {
console.error(`⚠️ WARNING: No learning paths found for ${source}.`);