@dnax/core 0.2.7 → 0.2.8
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 +2 -2
- package/lib/schema.ts +6 -1
- package/package.json +1 -1
package/driver/mongo/rest.ts
CHANGED
|
@@ -298,7 +298,7 @@ class useRest {
|
|
|
298
298
|
}),
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
return resolve(data);
|
|
301
|
+
return resolve(toJson(data));
|
|
302
302
|
} catch (err) {
|
|
303
303
|
return reject(err);
|
|
304
304
|
}
|
|
@@ -659,7 +659,7 @@ class useRest {
|
|
|
659
659
|
update.$set = transformAllDate(update.$set);
|
|
660
660
|
update.$set = await hashPasswordAuto(update.$set, col);
|
|
661
661
|
// data = transformAllDate(data);
|
|
662
|
-
//
|
|
662
|
+
//update.$set = deepSetId(col, update.$set);
|
|
663
663
|
var { valid, output, error } = this.validator(
|
|
664
664
|
collection,
|
|
665
665
|
update.$set,
|
package/lib/schema.ts
CHANGED
|
@@ -50,7 +50,12 @@ function buildSchema(col: Collection) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
if (f?.type == "relationship") {
|
|
53
|
-
propertySchema[f.name] = v
|
|
53
|
+
propertySchema[f.name] = v
|
|
54
|
+
.string()
|
|
55
|
+
.optional()
|
|
56
|
+
.messages({
|
|
57
|
+
"string.base": `${f.name} must be ObjectId or String`,
|
|
58
|
+
});
|
|
54
59
|
}
|
|
55
60
|
|
|
56
61
|
if (f?.type == "relationship" && f.relation?.hasMany) {
|