diff --git a/.changeset/hungry-wombats-sparkle.md b/.changeset/hungry-wombats-sparkle.md new file mode 100644 index 00000000..40d59d73 --- /dev/null +++ b/.changeset/hungry-wombats-sparkle.md @@ -0,0 +1,5 @@ +--- +"@ima/plugin-http-client": minor +--- + +Added filter to data field mapping diff --git a/packages/plugin-http-client/src/rest/BaseEntity.ts b/packages/plugin-http-client/src/rest/BaseEntity.ts index fd08e663..ed3e8ac8 100644 --- a/packages/plugin-http-client/src/rest/BaseEntity.ts +++ b/packages/plugin-http-client/src/rest/BaseEntity.ts @@ -103,7 +103,12 @@ export class BaseEntity { const processedDataFieldMapping: { [key: string]: MapperItem } = {}; Object.entries(dataFieldMapping).forEach(([key, value]) => { - processedDataFieldMapping[key] = BaseMapper.createMapperItem(value, key); + if (value) { + processedDataFieldMapping[key] = BaseMapper.createMapperItem( + value, + key + ); + } }); return processedDataFieldMapping;