@punks/backend-entity-manager 0.0.159 → 0.0.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -182,7 +182,12 @@ class EntitySerializer {
182
182
  }
183
183
  const entity = {};
184
184
  for (const column of definition.columns) {
185
- entity[column.selector] = this.parseColumnValue(record, column);
185
+ if (column.parseAction) {
186
+ column.parseAction(record[column.name], entity);
187
+ }
188
+ else {
189
+ entity[column.selector] = this.parseColumnValue(record, column);
190
+ }
186
191
  }
187
192
  const idField = definition.columns.find((x) => x.idColumn || x.selector === "id");
188
193
  return {
@@ -707,9 +712,7 @@ class EntitiesImportCommand {
707
712
  fileName: input.file.fileName,
708
713
  });
709
714
  const importEntities = await this.parseImportFile(input.file.content, input.format);
710
- await this.services
711
- .resolveSerializer()
712
- .import(importEntities, input.payload);
715
+ await this.services.resolveSerializer().import(importEntities.map((x) => x.item), input.payload);
713
716
  return {
714
717
  statistics: {
715
718
  importedCount: importEntities.length,