nox-validation 1.3.8 → 1.4.0

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 +15 -6
  2. package/package.json +1 -1
package/lib/helpers.js CHANGED
@@ -780,12 +780,21 @@ const buildNestedStructure = ({
780
780
  childFields = getCachedFields(relationDetail, relational_fields);
781
781
  }
782
782
  if (item.meta.interface === constants.interfaces.TRANSLATIONS) {
783
- childFields = childFields.filter(
784
- (f) =>
785
- f.field !== relationDetail.foreign_field &&
786
- f.field !== relationDetail.junction_field_this &&
787
- f.field !== relationDetail.junction_field_foreign
788
- );
783
+ childFields = childFields.map(f => {
784
+ if (
785
+ f.field === relationDetail.foreign_field ||
786
+ f.field === relationDetail.junction_field_this
787
+ ) {
788
+ return {
789
+ ...f,
790
+ meta: {
791
+ ...f.meta,
792
+ interface: "none"
793
+ }
794
+ };
795
+ }
796
+ return f;
797
+ });
789
798
  }
790
799
 
791
800
  if (childFields) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nox-validation",
3
- "version": "1.3.8",
3
+ "version": "1.4.0",
4
4
  "description": "validate dynamic schema",
5
5
  "main": "index.js",
6
6
  "scripts": {