@open-tender/utils 0.1.51 → 0.1.52
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.
|
@@ -32,14 +32,13 @@ const useGiftCardAssignForm = (loading, error, assign, callback) => {
|
|
|
32
32
|
const handleSubmit = (evt) => {
|
|
33
33
|
var _a, _b, _c, _d;
|
|
34
34
|
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
35
|
-
setSubmitting(true);
|
|
36
35
|
const card_number = parseInt(data.card_number);
|
|
37
36
|
if (isNaN(card_number)) {
|
|
38
|
-
setSubmitting(false);
|
|
39
37
|
setErrors({ card_number: 'Card numbers must be all digits' });
|
|
40
38
|
((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus());
|
|
41
39
|
}
|
|
42
40
|
else {
|
|
41
|
+
setSubmitting(true);
|
|
43
42
|
assign(card_number, callback);
|
|
44
43
|
((_c = submitRef.current) === null || _c === void 0 ? void 0 : _c.blur) && ((_d = submitRef.current) === null || _d === void 0 ? void 0 : _d.blur());
|
|
45
44
|
}
|
|
@@ -29,14 +29,13 @@ export const useGiftCardAssignForm = (loading, error, assign, callback) => {
|
|
|
29
29
|
const handleSubmit = (evt) => {
|
|
30
30
|
var _a, _b, _c, _d;
|
|
31
31
|
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
32
|
-
setSubmitting(true);
|
|
33
32
|
const card_number = parseInt(data.card_number);
|
|
34
33
|
if (isNaN(card_number)) {
|
|
35
|
-
setSubmitting(false);
|
|
36
34
|
setErrors({ card_number: 'Card numbers must be all digits' });
|
|
37
35
|
((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus());
|
|
38
36
|
}
|
|
39
37
|
else {
|
|
38
|
+
setSubmitting(true);
|
|
40
39
|
assign(card_number, callback);
|
|
41
40
|
((_c = submitRef.current) === null || _c === void 0 ? void 0 : _c.blur) && ((_d = submitRef.current) === null || _d === void 0 ? void 0 : _d.blur());
|
|
42
41
|
}
|
package/package.json
CHANGED