eleven-solutions-common-website-unique-web 20.0.4 → 20.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.
@@ -39,7 +39,17 @@ const UpdateUserDetails = ({ usermodalopen, closeusermodal, url, isDarkMode, })
|
|
39
39
|
});
|
40
40
|
fetchUserProfile();
|
41
41
|
}, [usermodalopen, userToken, user]);
|
42
|
-
const
|
42
|
+
const validateForm = () => {
|
43
|
+
if (!name || !mobile || !address) {
|
44
|
+
alert("Please fill in all required fields: Name, Mobile, and Address.");
|
45
|
+
return false;
|
46
|
+
}
|
47
|
+
return true;
|
48
|
+
};
|
49
|
+
const handleUpdate = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
50
|
+
event.preventDefault();
|
51
|
+
if (!validateForm())
|
52
|
+
return;
|
43
53
|
try {
|
44
54
|
const response = yield updateProfileApi(url, userToken, name, mobile, address);
|
45
55
|
if (response.status === 200) {
|
package/package.json
CHANGED
@@ -52,7 +52,17 @@ const UpdateUserDetails: React.FC<UpdateUserDetailsProps> = ({
|
|
52
52
|
fetchUserProfile();
|
53
53
|
}, [usermodalopen, userToken, user]);
|
54
54
|
|
55
|
-
const
|
55
|
+
const validateForm = () => {
|
56
|
+
if (!name || !mobile || !address) {
|
57
|
+
alert("Please fill in all required fields: Name, Mobile, and Address.");
|
58
|
+
return false;
|
59
|
+
}
|
60
|
+
return true;
|
61
|
+
};
|
62
|
+
|
63
|
+
const handleUpdate = async (event: React.MouseEvent<HTMLButtonElement>) => {
|
64
|
+
event.preventDefault();
|
65
|
+
if (!validateForm()) return;
|
56
66
|
try {
|
57
67
|
const response = await updateProfileApi(
|
58
68
|
url,
|