@open-tender/utils 0.1.35 → 0.1.36
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.
|
@@ -68,7 +68,6 @@ const useSignUpForm = (loading, error, signUp, callback, checkConfig = {}, hasTh
|
|
|
68
68
|
}
|
|
69
69
|
];
|
|
70
70
|
const fields = allFields.filter(i => !toRemove.includes(i.name));
|
|
71
|
-
console.log(data);
|
|
72
71
|
(0, react_1.useEffect)(() => {
|
|
73
72
|
return () => {
|
|
74
73
|
setData(initState);
|
|
@@ -99,13 +98,11 @@ const useSignUpForm = (loading, error, signUp, callback, checkConfig = {}, hasTh
|
|
|
99
98
|
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
100
99
|
setErrors({});
|
|
101
100
|
setSubmitting(true);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
// console.log('handleSubmit values', values)
|
|
108
|
-
signUp(data, callback);
|
|
101
|
+
const values = Object.assign({}, data);
|
|
102
|
+
if (values.birth_date) {
|
|
103
|
+
values.birth_date = (0, utils_1.slashesToDashes)(values.birth_date);
|
|
104
|
+
}
|
|
105
|
+
signUp(values, callback);
|
|
109
106
|
((_a = submitRef.current) === null || _a === void 0 ? void 0 : _a.blur) && ((_b = submitRef.current) === null || _b === void 0 ? void 0 : _b.blur());
|
|
110
107
|
};
|
|
111
108
|
return {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { useRef, useState, useEffect } from 'react';
|
|
2
|
-
import { makeBirthDate, makeFormErrors, makePhone
|
|
3
|
-
// slashesToDashes
|
|
4
|
-
} from '../utils';
|
|
2
|
+
import { makeBirthDate, makeFormErrors, makePhone, slashesToDashes } from '../utils';
|
|
5
3
|
import { genderOptions } from './useProfileForm';
|
|
6
4
|
const initState = {
|
|
7
5
|
first_name: '',
|
|
@@ -67,7 +65,6 @@ export const useSignUpForm = (loading, error, signUp, callback, checkConfig = {}
|
|
|
67
65
|
}
|
|
68
66
|
];
|
|
69
67
|
const fields = allFields.filter(i => !toRemove.includes(i.name));
|
|
70
|
-
console.log(data);
|
|
71
68
|
useEffect(() => {
|
|
72
69
|
return () => {
|
|
73
70
|
setData(initState);
|
|
@@ -98,13 +95,11 @@ export const useSignUpForm = (loading, error, signUp, callback, checkConfig = {}
|
|
|
98
95
|
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
99
96
|
setErrors({});
|
|
100
97
|
setSubmitting(true);
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
// console.log('handleSubmit values', values)
|
|
107
|
-
signUp(data, callback);
|
|
98
|
+
const values = Object.assign({}, data);
|
|
99
|
+
if (values.birth_date) {
|
|
100
|
+
values.birth_date = slashesToDashes(values.birth_date);
|
|
101
|
+
}
|
|
102
|
+
signUp(values, callback);
|
|
108
103
|
((_a = submitRef.current) === null || _a === void 0 ? void 0 : _a.blur) && ((_b = submitRef.current) === null || _b === void 0 ? void 0 : _b.blur());
|
|
109
104
|
};
|
|
110
105
|
return {
|
package/package.json
CHANGED