@koalarx/nest 3.1.20 → 3.1.22
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 {
|
|
76
76
|
selectSchema[prop.name] = true;
|
|
77
77
|
}
|
|
78
78
|
});
|
|
@@ -163,7 +163,7 @@ class RepositoryBase {
|
|
|
163
163
|
relationDeletes.push({
|
|
164
164
|
modelName: (0, KlString_1.toCamelCase)(modelName),
|
|
165
165
|
entityInstance,
|
|
166
|
-
schema:
|
|
166
|
+
schema: this.getWhereByIdSchema(item, item),
|
|
167
167
|
relations: [],
|
|
168
168
|
});
|
|
169
169
|
});
|
|
@@ -186,7 +186,7 @@ class RepositoryBase {
|
|
|
186
186
|
modelName: (0, KlString_1.toCamelCase)(modelName),
|
|
187
187
|
entityInstance,
|
|
188
188
|
schema: {
|
|
189
|
-
where:
|
|
189
|
+
where: this.getWhereByIdSchema(item, item),
|
|
190
190
|
data: this.entityToPrisma(item),
|
|
191
191
|
select: this.getSelectRootPrismaSchema(item.constructor),
|
|
192
192
|
},
|
|
@@ -323,7 +323,7 @@ class RepositoryBase {
|
|
|
323
323
|
return;
|
|
324
324
|
}
|
|
325
325
|
cache.set(cacheKey, item);
|
|
326
|
-
items.push(this.loadRelationForEntity(item, entityInstance, cache));
|
|
326
|
+
items.push(this.loadRelationForEntity(this.getWhereByIdSchema(new entityInstance(), item), entityInstance, cache));
|
|
327
327
|
});
|
|
328
328
|
relationQueries.push(Promise.all(items));
|
|
329
329
|
return;
|
|
@@ -382,9 +382,9 @@ class RepositoryBase {
|
|
|
382
382
|
return this.persistRelations(transaction, relation);
|
|
383
383
|
});
|
|
384
384
|
}));
|
|
385
|
-
})),
|
|
386
|
-
|
|
387
|
-
|
|
385
|
+
}), ...relationUpdates.map((relation) => transaction[relation.modelName].update(relation.schema)), ...relationDeletes.map((relation) => transaction[relation.modelName].deleteMany({
|
|
386
|
+
where: relation.schema,
|
|
387
|
+
}))),
|
|
388
388
|
]);
|
|
389
389
|
}
|
|
390
390
|
context(transactionalClient) {
|