@koalarx/nest 3.1.16 → 3.1.18

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.
@@ -72,7 +72,7 @@ class RepositoryBase {
72
72
  select: this.getSelectRootPrismaSchema(instance.constructor),
73
73
  };
74
74
  }
75
- else {
75
+ else if (!(instance instanceof list_1.List)) {
76
76
  selectSchema[prop.name] = true;
77
77
  }
78
78
  });
@@ -169,7 +169,7 @@ class RepositoryBase {
169
169
  ...this.entityToPrisma(item),
170
170
  [parentPropName]: this.getConnectPrismaSchemaForRelation(entity),
171
171
  },
172
- select: this.getSelectRootPrismaSchema(item),
172
+ select: this.getSelectRootPrismaSchema(item.constructor),
173
173
  },
174
174
  relations: this.listRelationEntities(item, true),
175
175
  });
@@ -181,7 +181,7 @@ class RepositoryBase {
181
181
  schema: {
182
182
  where: { id: item._id },
183
183
  data: this.entityToPrisma(item),
184
- select: this.getSelectRootPrismaSchema(item),
184
+ select: this.getSelectRootPrismaSchema(item.constructor),
185
185
  },
186
186
  relations: this.listRelationEntities(item, true),
187
187
  });
@@ -198,7 +198,7 @@ class RepositoryBase {
198
198
  schema: {
199
199
  where: { id: entityInstance._id },
200
200
  data: this.entityToPrisma(entityInstance),
201
- select: this.getSelectRootPrismaSchema(entityInstance),
201
+ select: this.getSelectRootPrismaSchema(entityInstance.constructor),
202
202
  },
203
203
  relations: this.listRelationEntities(entityInstance),
204
204
  });
@@ -309,7 +309,7 @@ class RepositoryBase {
309
309
  const entityInstance = list.entityType;
310
310
  relationKeys.push(propName);
311
311
  const items = [];
312
- data[propName].forEach((item) => {
312
+ data[propName]?.forEach((item) => {
313
313
  const cacheKey = `${entity.constructor.name}-${propName}-${this.getIdOnEntity(new entityInstance(), item)}`;
314
314
  if (cache.has(cacheKey)) {
315
315
  items.push(Promise.resolve(cache.get(cacheKey)));
@@ -360,7 +360,7 @@ class RepositoryBase {
360
360
  return transaction[(0, KlString_1.toCamelCase)(relation.constructor.name)]
361
361
  .create({
362
362
  data: this.entityToPrisma(relation),
363
- select: this.getSelectRootPrismaSchema(relation),
363
+ select: this.getSelectRootPrismaSchema(relation.constructor),
364
364
  })
365
365
  .then((response) => {
366
366
  const idPropName = this.getIdPropName(relation);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koalarx/nest",
3
- "version": "3.1.16",
3
+ "version": "3.1.18",
4
4
  "description": "",
5
5
  "author": "Igor D. Rangel",
6
6
  "license": "MIT",