feat(frontend): LearningObjectService en LearningPathService geïmplementeerd.

This commit is contained in:
Gerald Schmittinger 2025-03-23 08:56:34 +01:00
parent 8b0fc4263f
commit 3c3fddb7d0
24 changed files with 375 additions and 84 deletions

View file

@ -0,0 +1,13 @@
import {GetEndpoint} from "@/services/api-client/endpoints/get-endpoint.ts";
import {LearningPath, type LearningPathDTO} from "@/services/learning-content/learning-path.ts";
import type {RemoteResource} from "@/services/api-client/remote-resource.ts";
const searchLearningPathsEndpoint = new GetEndpoint<{}, {query: string}, LearningPathDTO[]>(
"/learningObjects/:query"
);
export function searchLearningPaths(query: string): RemoteResource<LearningPath[]> {
return searchLearningPathsEndpoint
.get({}, {query: query})
.map(dtos => dtos.map(dto => LearningPath.fromDTO(dto)));
}