eleven-solutions-common-website-unique-web 22.0.10 → 22.0.12
Sign up to get free protection for your applications and to get access to all the features.
@@ -32,9 +32,9 @@ const UserForm = ({ url }) => {
|
|
32
32
|
const queryParams = new URLSearchParams(window.location.search);
|
33
33
|
const id = queryParams.get("id");
|
34
34
|
useEffect(() => {
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
try {
|
36
|
+
if (id) {
|
37
|
+
const fetchUserData = () => __awaiter(void 0, void 0, void 0, function* () {
|
38
38
|
const fetchedUser = yield fetchUserByIdApi(url, id);
|
39
39
|
if (fetchedUser) {
|
40
40
|
const user = fetchedUser;
|
@@ -47,15 +47,15 @@ const UserForm = ({ url }) => {
|
|
47
47
|
setRoleType(user.roleType);
|
48
48
|
setGender(user.gender);
|
49
49
|
}
|
50
|
-
}
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
50
|
+
});
|
51
|
+
fetchUserData();
|
52
|
+
}
|
53
|
+
}
|
54
|
+
catch (error) {
|
55
|
+
console.error("Error fetching User:", error);
|
56
|
+
toast.error("Failed to fetch the User.", { id: "fetchUserError" });
|
57
|
+
setHasError(true);
|
58
|
+
setLoading(false);
|
59
59
|
}
|
60
60
|
}, [id]);
|
61
61
|
useEffect(() => {
|