@movalib/movalib-commons 1.1.64 → 1.1.65
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.
|
@@ -150,6 +150,7 @@ var AccountValidation = function (_a) {
|
|
|
150
150
|
var _a, _b, _c, _d, _e;
|
|
151
151
|
var newForm = validationForm;
|
|
152
152
|
var newField;
|
|
153
|
+
newForm.phoneNumber = (0, Tools_1.validateField)(validationForm.phoneNumber, function (value) { return !!value; }, 'Champ obligatoire');
|
|
153
154
|
// Validator 'phoneNumber'
|
|
154
155
|
if ((_a = newForm.phoneNumber) === null || _a === void 0 ? void 0 : _a.value) {
|
|
155
156
|
if (((_b = newForm.phoneNumber) === null || _b === void 0 ? void 0 : _b.value.length) < 10) {
|
package/package.json
CHANGED
|
@@ -176,19 +176,21 @@ const AccountValidation: FunctionComponent<AccountValidationProps> = ({ movaAppT
|
|
|
176
176
|
let newForm: MovaValidationForm = validationForm;
|
|
177
177
|
let newField: MovaFormField;
|
|
178
178
|
|
|
179
|
+
newForm.phoneNumber = validateField(validationForm.phoneNumber, value => !!value, 'Champ obligatoire');
|
|
180
|
+
|
|
179
181
|
// Validator 'phoneNumber'
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
if(newForm.phoneNumber?.value){
|
|
183
|
+
if(newForm.phoneNumber?.value.length < 10){
|
|
184
|
+
newField = { value: validationForm.phoneNumber?.value, error: "Le n° de téléphone est invalide."};
|
|
185
|
+
} else {
|
|
186
|
+
newField ={ value: validationForm.phoneNumber?.value, error: ''};
|
|
187
|
+
}
|
|
188
|
+
newForm = { ...newForm, ...{ phoneNumber: newField } };
|
|
185
189
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
setValidationForm(newForm);
|
|
190
|
+
|
|
191
|
+
setValidationForm(newForm);
|
|
190
192
|
|
|
191
|
-
|
|
193
|
+
return !Boolean(newForm.phoneNumber?.error);
|
|
192
194
|
}
|
|
193
195
|
|
|
194
196
|
const resendCode = () => {
|