@koalarx/nest 3.1.39 → 3.1.41
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.
|
@@ -264,6 +264,15 @@ class RepositoryBase {
|
|
|
264
264
|
prismaSchema[key] = this.getConnectPrismaSchemaForRelation(entity[key]);
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
+
else if (entity[key] === null) {
|
|
268
|
+
const propDefinitions = auto_mapping_list_1.AutoMappingList.getPropDefinitions(entity.constructor, key);
|
|
269
|
+
const relationEntity = auto_mapping_list_1.AutoMappingList.getSourceByName(propDefinitions?.type ?? '');
|
|
270
|
+
if (relationEntity) {
|
|
271
|
+
prismaSchema[key] = {
|
|
272
|
+
disconnect: true,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
}
|
|
267
276
|
else if (!(entity[key] instanceof list_1.List)) {
|
|
268
277
|
prismaSchema[key] = entity[key];
|
|
269
278
|
}
|
|
@@ -412,7 +421,8 @@ class RepositoryBase {
|
|
|
412
421
|
if (relationPropName &&
|
|
413
422
|
!(relation[relationPropName] instanceof list_1.List)) {
|
|
414
423
|
relation[relationPropName] =
|
|
415
|
-
this.getConnectPrismaSchemaForRelation(relationUpdate.entityInstance,
|
|
424
|
+
this.getConnectPrismaSchemaForRelation(relationUpdate.entityInstance, relation[relationPropName] ??
|
|
425
|
+
relationUpdate.schema.where);
|
|
416
426
|
}
|
|
417
427
|
return transaction[(0, KlString_1.toCamelCase)(relation.constructor.name)]
|
|
418
428
|
.create({
|