feat(frontend): LearningObjectService en LearningPathService geïmplementeerd.
This commit is contained in:
parent
8b0fc4263f
commit
3c3fddb7d0
24 changed files with 375 additions and 84 deletions
|
@ -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)));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue