prisma-mock 0.0.31 → 0.0.32
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/lib/index.js +14 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -179,7 +179,20 @@ const createPrismaMock = async (data = {}, pathToSchema, client = (0, jest_mock_
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
if (c.disconnect) {
|
|
182
|
-
|
|
182
|
+
if (field.relationFromFields.length > 0) {
|
|
183
|
+
d = Object.assign(Object.assign({}, d), { [field.relationFromFields[0]]: null });
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
const joinfield = getJoinField(field);
|
|
187
|
+
delegate.update({
|
|
188
|
+
data: {
|
|
189
|
+
[joinfield.relationFromFields[0]]: null
|
|
190
|
+
},
|
|
191
|
+
where: {
|
|
192
|
+
[joinfield.relationFromFields[0]]: item[joinfield.relationToFields[0]]
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
183
196
|
}
|
|
184
197
|
const _e = d, _f = field.name, _update = _e[_f], rest = __rest(_e, [typeof _f === "symbol" ? _f : _f + ""]);
|
|
185
198
|
d = rest;
|