Skip to content

Commit

Permalink
#48: Updated annotations handling (#49)
Browse files Browse the repository at this point in the history
Co-authored-by: darnjo <josh@reso.org>
  • Loading branch information
darnjo and darnjo authored Mar 25, 2024
1 parent f7759b5 commit d8c1c62
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions lib/process-lookup-resource-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,31 @@ const processLookupResourceMetadata = ({
const lookupMetadata = {
lookupName,
lookupValue: StandardLookupValue || LookupValue,
type: EDM_STRING_TYPE,
annotations: [
type: EDM_STRING_TYPE
};

const annotations = [];

if (LegacyODataValue && LegacyODataValue?.trim()?.length) {
annotations.push(
{
term: LEGACY_ODATA_VALUE_TERM,
value: LegacyODataValue,
},
],
};
});
}

if (StandardLookupValue?.length) {
lookupMetadata.annotations.push({
if (StandardLookupValue && StandardLookupValue?.trim()?.length) {
annotations.push({
term: LOOKUP_STANDARD_NAME_ANNOTATION_TERM,
value: StandardLookupValue,
});
}

return lookupMetadata;
if (annotations?.length) {
return { ...lookupMetadata, annotations };
} else {
return lookupMetadata;
}
}
) || []),
],
Expand Down

0 comments on commit d8c1c62

Please sign in to comment.