Skip to content

Commit

Permalink
use constants with miningful names instead of oidIdParts[N]
Browse files Browse the repository at this point in the history
  • Loading branch information
aramovic79 committed Dec 10, 2024
1 parent 0135366 commit 1218ec6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ const createEntityTypeMappingsItemTemplate = (entity) => {
}
} else if (entity[ENTITY_RELATIONSHIP_ANNOTATION]) {
const ordIdParts = entity[ENTITY_RELATIONSHIP_ANNOTATION].split(":");
const namespace = ordIdParts[0];
const entityName = ordIdParts[1];
const version = ordIdParts[2] || "v1";
return {
ordId: `${ordIdParts[0]}:entityType:${entityName}:${ordIdParts[2] || "v1"}`,
ordId: `${namespace}:entityType:${entityName}:${version}`,
entityName,
...entity
};
Expand Down

0 comments on commit 1218ec6

Please sign in to comment.