nox-validation 1.2.5 → 1.2.7
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 +1 -1
- package/lib/validate.js +1 -1
- package/package.json +1 -1
package/lib/helpers.js
CHANGED
|
@@ -1169,7 +1169,7 @@ const getDefaultValues = (tree) => {
|
|
|
1169
1169
|
};
|
|
1170
1170
|
|
|
1171
1171
|
const extractRelationalParents=(path)=> {
|
|
1172
|
-
const match = path?.match(/^(
|
|
1172
|
+
const match = path?.match(/^([^.\[\]]+)\.(create|update|delete|existing)\[(\d+)\](?:\.(.*))?/);
|
|
1173
1173
|
if (match) {
|
|
1174
1174
|
const secondParent = match[1];
|
|
1175
1175
|
const firstParent = match[0].split('.')[0] + '.' + match[2] + '[' + path.match(/\[(\d+)\]/)[1] + ']'; //
|
package/lib/validate.js
CHANGED
|
@@ -819,7 +819,7 @@ const validate = (data) => {
|
|
|
819
819
|
const error_messages =
|
|
820
820
|
constants.LOCALE_MESSAGES[language] ?? constants.LOCALE_MESSAGES[constants.LANGUAGES.en];
|
|
821
821
|
|
|
822
|
-
let result = { status: true, errors: {}, data: formData };
|
|
822
|
+
let result = { status: true, errors: {}, data: structuredClone(formData) };
|
|
823
823
|
|
|
824
824
|
const updateValue = (key, value) => {
|
|
825
825
|
setValue(result.data, key, value);
|