nox-validation 1.0.5 → 1.0.6

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/helpers.js +4 -3
  2. package/package.json +1 -1
package/lib/helpers.js CHANGED
@@ -592,7 +592,9 @@ const buildNestedStructure = (
592
592
 
593
593
  const definedType =
594
594
  apiVersion === constants.API_VERSION.V1 ? convertTypesV1(item) : convertTypes(item);
595
- if (definedType.find_relations) {
595
+ const isUserKey = item?.path?.includes("updated_by") || item?.path?.includes("created_by");
596
+
597
+ if (definedType.find_relations && !isUserKey) {
596
598
  const relationDetail = getForeignCollectionDetails({
597
599
  relations: relations,
598
600
  collection: item?.schema_id,
@@ -612,9 +614,8 @@ const buildNestedStructure = (
612
614
  } else {
613
615
  childFields = getCachedFields(relationDetail, relational_fields);
614
616
  }
615
- const isUserKey = item?.path?.includes("updated_by") || item?.path?.includes("created_by");
616
617
 
617
- if (childFields && !isUserKey) {
618
+ if (childFields) {
618
619
  childFields = buildNestedStructure(
619
620
  childFields,
620
621
  allFields,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nox-validation",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "validate dynamic schema",
5
5
  "main": "index.js",
6
6
  "scripts": {