nox-validation 1.0.4 → 1.0.5
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/lib/helpers.js +5 -5
- package/package.json +1 -1
package/lib/helpers.js
CHANGED
|
@@ -504,7 +504,7 @@ const getForeignCollectionDetails = ({
|
|
|
504
504
|
|
|
505
505
|
if (isSingleRelation) {
|
|
506
506
|
const mainTable = relations.find(
|
|
507
|
-
(d) => d.many_collection_id === collection && d.
|
|
507
|
+
(d) => d.many_collection_id === collection && d.many_field_id === field
|
|
508
508
|
);
|
|
509
509
|
if (!mainTable) return {};
|
|
510
510
|
|
|
@@ -592,7 +592,6 @@ const buildNestedStructure = (
|
|
|
592
592
|
|
|
593
593
|
const definedType =
|
|
594
594
|
apiVersion === constants.API_VERSION.V1 ? convertTypesV1(item) : convertTypes(item);
|
|
595
|
-
|
|
596
595
|
if (definedType.find_relations) {
|
|
597
596
|
const relationDetail = getForeignCollectionDetails({
|
|
598
597
|
relations: relations,
|
|
@@ -613,8 +612,9 @@ const buildNestedStructure = (
|
|
|
613
612
|
} else {
|
|
614
613
|
childFields = getCachedFields(relationDetail, relational_fields);
|
|
615
614
|
}
|
|
615
|
+
const isUserKey = item?.path?.includes("updated_by") || item?.path?.includes("created_by");
|
|
616
616
|
|
|
617
|
-
if (childFields) {
|
|
617
|
+
if (childFields && !isUserKey) {
|
|
618
618
|
childFields = buildNestedStructure(
|
|
619
619
|
childFields,
|
|
620
620
|
allFields,
|
|
@@ -822,14 +822,14 @@ const generateFieldCompareRules = (rule) => {
|
|
|
822
822
|
return modifiedRule;
|
|
823
823
|
};
|
|
824
824
|
|
|
825
|
-
const generateModifiedRules = (meta,custom_message) => {
|
|
825
|
+
const generateModifiedRules = (meta, custom_message) => {
|
|
826
826
|
return meta?.validations?.rules?.map((rule, index) => {
|
|
827
827
|
let modifiedRule = {
|
|
828
828
|
identifier: String(index),
|
|
829
829
|
case: constants.rulesTypes.RULES_COMPARE,
|
|
830
830
|
value: [],
|
|
831
831
|
options: {},
|
|
832
|
-
custom_message
|
|
832
|
+
custom_message,
|
|
833
833
|
};
|
|
834
834
|
switch (rule.rule) {
|
|
835
835
|
case "contains":
|