Skip to content

Commit

Permalink
Do not include missing competencies in ceasn json export
Browse files Browse the repository at this point in the history
  • Loading branch information
gloverkari committed Oct 4, 2023
1 parent 3595d2e commit 5b630f2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/main/server/adapter/ceasn/ceasn.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function competencyPromise(compId, competencies, allCompetencies, f, ctx,
try {
var c = competencies[compId];
if (!c) {
resolve(compId);
resolve(null);
return;
}
if (c == null) resolve(c);
Expand Down Expand Up @@ -399,11 +399,7 @@ async function cassFrameworkAsCeasn() {
};
}
for (let c of competencies) {
if (!c["@id"]) {
// URI does not reference a valid competency.
// For consistency with the data and possible debugging purposes, it should still be included in JSON-LD export
f["ceasn:hasTopChild"]["@list"].push(await ceasnExportUriTransform(c));
} else {
if (c && c["@id"]) {
if (!c["ceasn:isChildOf"] || c["ceasn:isChildOf"] == null) {
f["ceasn:hasTopChild"]["@list"].push(await ceasnExportUriTransform(c["@id"]));
}
Expand Down

0 comments on commit 5b630f2

Please sign in to comment.