@dnax/core 0.1.13 → 0.1.14
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 -4
- package/package.json +1 -1
package/driver/mongo/rest.ts
CHANGED
|
@@ -82,6 +82,12 @@ class useRest {
|
|
|
82
82
|
let valid = true;
|
|
83
83
|
let output = { ...data };
|
|
84
84
|
let errorMxg;
|
|
85
|
+
let control = {
|
|
86
|
+
error: null,
|
|
87
|
+
value: null,
|
|
88
|
+
waring: null
|
|
89
|
+
}
|
|
90
|
+
|
|
85
91
|
/* let issue = err?.issues[0] || {};
|
|
86
92
|
let msg = `Field : ${issue?.path[0]?.key} - ${issue?.message}`;
|
|
87
93
|
*/
|
|
@@ -96,12 +102,12 @@ class useRest {
|
|
|
96
102
|
return sc.optional();
|
|
97
103
|
}
|
|
98
104
|
);
|
|
99
|
-
|
|
105
|
+
control = partialSchema.validate(data) as any;
|
|
100
106
|
} else {
|
|
101
|
-
|
|
107
|
+
control = schema.validate(data) as any;
|
|
102
108
|
}
|
|
103
109
|
|
|
104
|
-
const { error, value } =
|
|
110
|
+
const { error, value } = control;
|
|
105
111
|
|
|
106
112
|
if (error) {
|
|
107
113
|
valid = false;
|
|
@@ -112,7 +118,6 @@ class useRest {
|
|
|
112
118
|
...data,
|
|
113
119
|
...output,
|
|
114
120
|
};
|
|
115
|
-
|
|
116
121
|
//console.log(value);
|
|
117
122
|
}
|
|
118
123
|
}
|