fix(backend): Testen DatabaseLearningObjectProvider gerepareerd na refactoring.

This commit is contained in:
Gerald Schmittinger 2025-04-16 07:58:55 +02:00
parent ee9afab6ca
commit 51268af79c
20 changed files with 72 additions and 210 deletions

View file

@ -29,14 +29,13 @@ export function mapToLearningPath(
admins,
image: dto.image ? Buffer.from(base64ToArrayBuffer(dto.image)) : null
});
const nodes = dto.nodes.map((nodeDto: LearningObjectNode, i: number) =>
const nodes = dto.nodes.map((nodeDto: LearningObjectNode) =>
repo.createNode({
learningPath: path,
learningObjectHruid: nodeDto.learningobject_hruid,
language: nodeDto.language,
version: nodeDto.version,
startNode: nodeDto.start_node ?? false,
nodeNumber: i,
createdAt: new Date(),
updatedAt: new Date()
})
@ -66,10 +65,10 @@ export function mapToLearningPath(
}
}).filter(it => it).map(it => it!);
fromNode.transitions = new Collection<LearningPathTransition>(transitions);
fromNode.transitions = new Collection<LearningPathTransition>(fromNode, transitions);
});
path.nodes = new Collection<LearningPathNode>(nodes);
path.nodes = new Collection<LearningPathNode>(path, nodes);
return path;
}