@webtypen/webframez-core 0.2.38 → 0.2.39
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.
|
@@ -137,12 +137,17 @@ class DataBuilder {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
if (typeof fields[key].schema === "object") {
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
if (fields[key].type === "array") {
|
|
141
|
+
if (value && value.length > 0) {
|
|
142
|
+
for (let i in value) {
|
|
143
|
+
const entryPath = fieldPath + "[" + i + "]";
|
|
144
|
+
errors = yield this.validateFields(db, type, fields[key].schema, req, errors, entryPath);
|
|
145
|
+
}
|
|
144
146
|
}
|
|
145
147
|
}
|
|
148
|
+
else if (fields[key].type === "object") {
|
|
149
|
+
errors = yield this.validateFields(db, type, fields[key].schema, req, errors, fieldPath);
|
|
150
|
+
}
|
|
146
151
|
}
|
|
147
152
|
if (fields[key].validation && fields[key].validation.trim() !== "") {
|
|
148
153
|
// @ToDo
|
package/package.json
CHANGED
|
@@ -183,11 +183,15 @@ export class DataBuilder {
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
if (typeof fields[key].schema === "object") {
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
186
|
+
if (fields[key].type === "array") {
|
|
187
|
+
if (value && value.length > 0) {
|
|
188
|
+
for (let i in value) {
|
|
189
|
+
const entryPath = fieldPath + "[" + i + "]";
|
|
190
|
+
errors = await this.validateFields(db, type, fields[key].schema, req, errors, entryPath);
|
|
191
|
+
}
|
|
190
192
|
}
|
|
193
|
+
} else if (fields[key].type === "object") {
|
|
194
|
+
errors = await this.validateFields(db, type, fields[key].schema, req, errors, fieldPath);
|
|
191
195
|
}
|
|
192
196
|
}
|
|
193
197
|
|