style: fix linting issues met Prettier
This commit is contained in:
parent
bdc689a4e1
commit
0ec296bf3d
2 changed files with 21 additions and 20 deletions
|
@ -33,22 +33,23 @@ export class LearningPathNode {
|
||||||
learningobjectHruid: dto.learningobject_hruid,
|
learningobjectHruid: dto.learningobject_hruid,
|
||||||
version: dto.version,
|
version: dto.version,
|
||||||
language: dto.language,
|
language: dto.language,
|
||||||
transitions: dto.transitions.map((transDto) => {
|
transitions: dto.transitions
|
||||||
const nextNodeDto = otherNodes.find(
|
.map((transDto) => {
|
||||||
(it) =>
|
const nextNodeDto = otherNodes.find(
|
||||||
it.learningobject_hruid === transDto.next.hruid &&
|
(it) =>
|
||||||
it.language === transDto.next.language &&
|
it.learningobject_hruid === transDto.next.hruid &&
|
||||||
it.version === transDto.next.version,
|
it.language === transDto.next.language &&
|
||||||
);
|
it.version === transDto.next.version,
|
||||||
if (nextNodeDto) {
|
);
|
||||||
return {
|
if (nextNodeDto) {
|
||||||
next: LearningPathNode.fromDTOAndOtherNodes(nextNodeDto, otherNodes),
|
return {
|
||||||
default: transDto.default,
|
next: LearningPathNode.fromDTOAndOtherNodes(nextNodeDto, otherNodes),
|
||||||
};
|
default: transDto.default,
|
||||||
}
|
};
|
||||||
return undefined
|
}
|
||||||
|
return undefined;
|
||||||
}).filter(it => it !== undefined),
|
})
|
||||||
|
.filter((it) => it !== undefined),
|
||||||
createdAt: new Date(dto.created_at),
|
createdAt: new Date(dto.created_at),
|
||||||
updatedAt: new Date(dto.updatedAt),
|
updatedAt: new Date(dto.updatedAt),
|
||||||
done: dto.done,
|
done: dto.done,
|
||||||
|
|
|
@ -88,10 +88,10 @@ export class LearningPath {
|
||||||
|
|
||||||
static getStartNode(dto: LearningPathDTO): LearningPathNodeDTO {
|
static getStartNode(dto: LearningPathDTO): LearningPathNodeDTO {
|
||||||
const startNodeDtos = dto.nodes.filter((it) => it.start_node === true);
|
const startNodeDtos = dto.nodes.filter((it) => it.start_node === true);
|
||||||
if (startNodeDtos.length < 1) { // The learning path has no starting node -> use the first node.
|
if (startNodeDtos.length < 1) {
|
||||||
|
// The learning path has no starting node -> use the first node.
|
||||||
return dto.nodes[0];
|
return dto.nodes[0];
|
||||||
} // The learning path has 1 or more starting nodes -> use the first start node.
|
} // The learning path has 1 or more starting nodes -> use the first start node.
|
||||||
return startNodeDtos[0];
|
return startNodeDtos[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue