From 5b630f2626958fe11bd1955179850e720d11526d Mon Sep 17 00:00:00 2001 From: "kari.glover" Date: Wed, 4 Oct 2023 13:10:58 -0700 Subject: [PATCH] Do not include missing competencies in ceasn json export --- src/main/server/adapter/ceasn/ceasn.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/server/adapter/ceasn/ceasn.js b/src/main/server/adapter/ceasn/ceasn.js index 84dde4148..3e6a05a73 100644 --- a/src/main/server/adapter/ceasn/ceasn.js +++ b/src/main/server/adapter/ceasn/ceasn.js @@ -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); @@ -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"])); }