feat: interface toevoegingen voor het type any te vermijden

This commit is contained in:
Gabriellvl 2025-03-01 18:03:14 +01:00
parent ae4d76a84b
commit 13f563bb56
2 changed files with 48 additions and 8 deletions

View file

@ -1,12 +1,6 @@
import { fetchWithLogging } from "../util/apiHelper.js";
import { DWENGO_API_BASE } from "../config/config.js";
interface LearningPathResponse {
success: boolean;
source: string;
data: any[] | null;
message?: string;
}
import {LearningPath, LearningPathResponse} from "../interfaces/learningPath.js";
export async function fetchLearningPaths(
hruids: string[],
@ -25,7 +19,7 @@ export async function fetchLearningPaths(
const apiUrl = `${DWENGO_API_BASE}/learningPath/getPathsFromIdList`;
const params = { pathIdList: JSON.stringify({ hruids }), language };
const learningPaths = await fetchWithLogging<any>(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}.`);