@dnax/core 0.4.0 → 0.4.1
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/driver/mongo/rest.ts +9 -0
- package/package.json +1 -1
package/driver/mongo/rest.ts
CHANGED
|
@@ -239,6 +239,10 @@ class useRest {
|
|
|
239
239
|
|
|
240
240
|
var { valid, output, error } = this.validator(collection, data);
|
|
241
241
|
if (!valid) fn.error(error, 400);
|
|
242
|
+
data = {
|
|
243
|
+
...output,
|
|
244
|
+
...data,
|
|
245
|
+
};
|
|
242
246
|
|
|
243
247
|
if (col?.hooks?.beforeOperation && useHook) {
|
|
244
248
|
await col.hooks.beforeOperation({
|
|
@@ -339,7 +343,12 @@ class useRest {
|
|
|
339
343
|
d = await hashPasswordAuto(d, col);
|
|
340
344
|
d = deepSetId(col, d);
|
|
341
345
|
var { valid, output, error } = this.validator(collection, d);
|
|
346
|
+
|
|
342
347
|
if (!valid) fn.error(error, 400);
|
|
348
|
+
d = {
|
|
349
|
+
...output,
|
|
350
|
+
...d,
|
|
351
|
+
};
|
|
343
352
|
}
|
|
344
353
|
|
|
345
354
|
if (col?.hooks?.beforeOperation && useHook) {
|