nox-validation 1.7.0 → 1.7.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.
Files changed (2) hide show
  1. package/lib/validate.js +17 -7
  2. package/package.json +1 -1
package/lib/validate.js CHANGED
@@ -1239,7 +1239,20 @@ const validateField = (
1239
1239
  }
1240
1240
  if (field.children?.length > 0) {
1241
1241
  value.forEach((item, index) => {
1242
- field.children.forEach((child) =>
1242
+ field.children.forEach((child) => {
1243
+ let trPath =
1244
+ field?.meta?.parentInterface ===
1245
+ constants.interfaces.TRANSLATIONS && item["languages_code"]
1246
+ ? `${currentPath}.${item["languages_code"]}`
1247
+ : null;
1248
+
1249
+ if (
1250
+ trPath &&
1251
+ field.meta?.staticType === "update" &&
1252
+ trPath.includes(".update.")
1253
+ )
1254
+ trPath = trPath.replace(".update.", ".");
1255
+
1243
1256
  validateField(
1244
1257
  child,
1245
1258
  item[child.key.split(".").pop()],
@@ -1255,12 +1268,9 @@ const validateField = (
1255
1268
  existingForm,
1256
1269
  false,
1257
1270
  timeZone,
1258
- field?.meta?.parentInterface ===
1259
- constants.interfaces.TRANSLATIONS && item["languages_code"]
1260
- ? `${currentPath}.${item["languages_code"]}`
1261
- : null
1262
- )
1263
- );
1271
+ trPath
1272
+ );
1273
+ });
1264
1274
  });
1265
1275
  }
1266
1276
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nox-validation",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "validate dynamic schema",
5
5
  "main": "index.js",
6
6
  "scripts": {