eleven-solutions-common-website-unique-web 3.0.21 → 3.0.22

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ const UserForm = () => {
16
16
  const [mobile, setMobile] = useState("");
17
17
  const [address, setAddress] = useState("");
18
18
  const [roleType, setRoleType] = useState("");
19
- const [, setUser] = useState(null);
19
+ // const [, setUser] = useState<any>(null);
20
20
  const [isEditMode, setIsEditMode] = useState(false);
21
21
  const validateForm = () => {
22
22
  if (!userName || !email || !roleType) {
@@ -35,7 +35,7 @@ const UserForm = () => {
35
35
  if (fetchedUser) {
36
36
  const user = fetchedUser;
37
37
  setIsEditMode(true);
38
- setUser(user);
38
+ // setUser(user);
39
39
  setUserName(user.name);
40
40
  setEmail(user.email);
41
41
  setMobile(user.mobile);
@@ -50,23 +50,6 @@ const UserForm = () => {
50
50
  fetchUserData();
51
51
  }
52
52
  }, [id]);
53
- // const handleSubmit = async (event: React.MouseEvent<HTMLButtonElement>) => {
54
- // event.preventDefault();
55
- // if (!validateForm()) return;
56
- // try {
57
- // if (isEditMode) {
58
- // await updateUserApi(id, userName, mobile, address, roleType);
59
- // alert("User updated successfully");
60
- // } else {
61
- // await addUserApi(userName, email, mobile, address, roleType);
62
- // alert("User added successfully");
63
- // }
64
- // navigate("/admin/user");
65
- // } catch (error) {
66
- // console.error("Error adding/updating User:", error);
67
- // alert("Failed to add/update User");
68
- // }
69
- // };
70
53
  const handleSubmit = (event) => __awaiter(void 0, void 0, void 0, function* () {
71
54
  event.preventDefault();
72
55
  if (!validateForm())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "3.0.21",
3
+ "version": "3.0.22",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -10,7 +10,7 @@ const UserForm = () => {
10
10
  const [address, setAddress] = useState("");
11
11
  const [roleType, setRoleType] = useState("");
12
12
 
13
- const [, setUser] = useState<any>(null);
13
+ // const [, setUser] = useState<any>(null);
14
14
  const [isEditMode, setIsEditMode] = useState<boolean>(false);
15
15
 
16
16
  const validateForm = () => {
@@ -40,7 +40,7 @@ const UserForm = () => {
40
40
  roleType: string;
41
41
  };
42
42
  setIsEditMode(true);
43
- setUser(user);
43
+ // setUser(user);
44
44
  setUserName(user.name);
45
45
  setEmail(user.email);
46
46
  setMobile(user.mobile);
@@ -55,25 +55,6 @@ const UserForm = () => {
55
55
  }
56
56
  }, [id]);
57
57
 
58
- // const handleSubmit = async (event: React.MouseEvent<HTMLButtonElement>) => {
59
- // event.preventDefault();
60
- // if (!validateForm()) return;
61
-
62
- // try {
63
- // if (isEditMode) {
64
- // await updateUserApi(id, userName, mobile, address, roleType);
65
- // alert("User updated successfully");
66
- // } else {
67
- // await addUserApi(userName, email, mobile, address, roleType);
68
- // alert("User added successfully");
69
- // }
70
- // navigate("/admin/user");
71
- // } catch (error) {
72
- // console.error("Error adding/updating User:", error);
73
- // alert("Failed to add/update User");
74
- // }
75
- // };
76
-
77
58
  const handleSubmit = async (event: React.MouseEvent<HTMLButtonElement>) => {
78
59
  event.preventDefault();
79
60
  if (!validateForm()) return;
@@ -207,11 +188,3 @@ const UserForm = () => {
207
188
  };
208
189
 
209
190
  export default UserForm;
210
-
211
- // import React from "react";
212
-
213
- // function UserForm() {
214
- // return <div>UserForm</div>;
215
- // }
216
-
217
- // export default UserForm;