eleven-solutions-common-website-unique-web 1.0.20 → 1.0.22
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/admin/Taxionomies.js +1 -4
- package/dist/components/admin/TaxonomyForm.js +0 -2
- package/dist/components/admin/UserForm.js +2 -2
- package/dist/components/admin/Users.js +1 -3
- package/package.json +1 -1
- package/src/components/admin/Taxionomies.tsx +3 -8
- package/src/components/admin/TaxonomyForm.tsx +0 -2
- package/src/components/admin/UserForm.tsx +2 -2
- package/src/components/admin/Users.tsx +1 -3
@@ -65,9 +65,6 @@ const Taxionomies = () => {
|
|
65
65
|
};
|
66
66
|
return (_jsxs("div", { className: "container px-4 mx-auto mt-6", children: [_jsx("div", { className: "w-3/4", children: _jsx("h1", { className: "text-3xl font-bold text-blue-600 mb-5", children: "Taxonomy" }) }), _jsx("div", { className: "flex-grow ml-0 w-full mt-10", children: _jsxs("form", { className: "w-full ", children: [_jsx("label", { htmlFor: "default-search", className: "mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white", children: "Search" }), _jsxs("div", { className: "relative w-full", children: [_jsx("div", { className: "absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none", children: _jsx("svg", { className: "w-4 h-4 text-gray-500 dark:text-gray-400", "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 20 20", children: _jsx("path", { stroke: "currentColor", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z" }) }) }), _jsx("input", { type: "search", id: "default-search", className: "inline-block min-w-full p-3 ps-10 outline-none text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500", placeholder: "Search Taxonomies", required: true }), _jsx("button", { type: "submit", className: "text-white absolute end-1.5 bottom-1.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800", children: "Search" })] })] }) }), _jsx("div", { className: "flex-grow ml-0 w-3/4", children: _jsx("form", { className: "w-auto" }) }), _jsxs("div", { className: "flex-grow ml-0 mt-4 w-full", children: [_jsx("div", { className: "overflow-hidden border border-gray-200 dark:border-gray-700 md:rounded-lg mt-6", children: _jsxs("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [_jsx("thead", { className: "bg-gray-50 dark:bg-gray-800", children: _jsxs("tr", { children: [_jsx("th", { scope: "col", className: "px-4 py-3.5 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Actions" }), _jsx("th", { scope: "col", className: "py-3.5 px-4 text-md font-normal text-left rtl:text-right text-gray-500 dark:text-gray-400", children: "Type" })] }) }), _jsx("tbody", { className: "bg-white divide-y divide-gray-200 dark:divide-gray-700 dark:bg-gray-900", children: paginatedTaxonomies.map((taxonomy, index) => (_jsxs("tr", { children: [_jsx("td", { className: "px-4 py-4 text-sm whitespace-nowrap", children: _jsx("div", { className: "flex items-center gap-x-6", children: taxonomy.isEdit ? (_jsx("a", { href: `/admin/taxinomies/taxonomyform?id=${taxonomy.id}`, onClick: () => handleViewClick(taxonomy.id, taxonomy.type), className: "text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" }) }) })) : taxonomy.isView ? (_jsx("a", { href: `/admin/taxinomies/taxonomyform?id=${taxonomy.id}`, onClick: () => handleViewClick(taxonomy.id, taxonomy.type), className: "text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-blue-500 focus:outline-none", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5", children: [_jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M12 4.5c4.142 0 7.788 2.93 9 7.5-1.212 4.57-4.858 7.5-9 7.5s-7.788-2.93-9-7.5c1.212-4.57 4.858-7.5 9-7.5z" }), _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M12 9a3 3 0 100 6 3 3 0 000-6z" })] }) })) : null }) }), _jsx("td", { className: "px-4 py-4 text-sm font-medium text-gray-700 whitespace-nowrap", children: _jsx("div", { className: "inline-flex items-center gap-x-3", children: _jsx("div", { className: "flex items-center gap-x-2", children: _jsx("div", { children: _jsx("h2", { className: " text-sm font-medium text-gray-800 dark:text-white ", children: taxonomy.type }) }) }) }) })] }, taxonomy.id || index))) })] }) }), _jsxs("div", { className: "flex items-center justify-between mt-6", children: [_jsxs("button", { onClick: handlePreviousPage, disabled: currentPage === 1, className: "flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6.75 15.75L3 12m0 0l3.75-3.75M3 12h18" }) }), _jsx("span", { children: "previous" })] }), _jsx("div", { className: "items-center hidden lg:flex gap-x-3", children: Array.from({ length: totalPages }, (_, index) => (_jsx("button", { onClick: () => handlePageClick(index + 1), className: `px-2 py-1 text-sm ${currentPage === index + 1
|
67
67
|
? "text-blue-500 bg-blue-100"
|
68
|
-
: "text-gray-500 hover:bg-gray-100"} rounded-md`, children: index + 1 }, index + 1))) }), _jsxs("button", { onClick: handleNextPage, disabled: currentPage === totalPages, className: "flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800", children: [_jsx("span", { children: "Next" }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3" }) })] })] }), _jsx("div", { className: "flex-grow ml-0 mt-4 w-0", children: _jsxs("button", { type: "button", onClick: () => {
|
69
|
-
window.history.pushState({}, "", "/admin/taxinomies/taxonomyform");
|
70
|
-
// Add any logic here to handle rendering the new content
|
71
|
-
}, className: "flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80", children: [_jsx(FaPlus, { className: "mr-2 font-medium" }), "Taxonomy"] }) })] })] }));
|
68
|
+
: "text-gray-500 hover:bg-gray-100"} rounded-md`, children: index + 1 }, index + 1))) }), _jsxs("button", { onClick: handleNextPage, disabled: currentPage === totalPages, className: "flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800", children: [_jsx("span", { children: "Next" }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3" }) })] })] }), _jsx("div", { className: "flex-grow ml-0 mt-4 w-0", children: _jsxs("button", { type: "button", onClick: () => (window.location.href = "/admin/taxinomies/taxonomyform"), className: "flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80", children: [_jsx(FaPlus, { className: "mr-2 font-medium" }), "Taxonomy"] }) })] })] }));
|
72
69
|
};
|
73
70
|
export default Taxionomies;
|
@@ -166,13 +166,11 @@ const TaxonomyForm = () => {
|
|
166
166
|
handleFetchSimilarTaxonomies();
|
167
167
|
}
|
168
168
|
}, [type]);
|
169
|
-
// Check if the current pathname matches "/taxonomy/taxonomyform"
|
170
169
|
useEffect(() => {
|
171
170
|
if (window.location.pathname === "/taxinomies/taxonomyform") {
|
172
171
|
setIsSimilarTaxonomyOpen(true);
|
173
172
|
}
|
174
173
|
}, []);
|
175
|
-
// Handle form submission
|
176
174
|
const handleSubmit = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
177
175
|
event.preventDefault();
|
178
176
|
if (!validateForm())
|
@@ -83,7 +83,7 @@ const UserForm = () => {
|
|
83
83
|
yield addUserApi(userName, email, mobile, address, roleType);
|
84
84
|
alert("User added successfully");
|
85
85
|
}
|
86
|
-
window.location.href = "/admin/
|
86
|
+
window.location.href = "/admin/users";
|
87
87
|
}
|
88
88
|
catch (error) {
|
89
89
|
console.error("Error adding/updating User:", error);
|
@@ -104,7 +104,7 @@ const UserForm = () => {
|
|
104
104
|
setMobile("");
|
105
105
|
setAddress("");
|
106
106
|
setRoleType("");
|
107
|
-
window.location.href = "/admin/
|
107
|
+
window.location.href = "/admin/users";
|
108
108
|
};
|
109
109
|
return (_jsx("div", { className: "max-w-4xl p-6 mx-auto dark:bg-gray-800", children: _jsx("div", { children: _jsxs("form", { children: [_jsx("h1", { className: "text-3xl font-bold text-center text-blue-600 capitalize dark:text-white mb-4", children: isEditMode ? "Edit User" : "Add User" }), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["User Name ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: userName, onChange: (e) => setUserName(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter User Name" })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Email ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsx("input", { required: true, value: email, onChange: (e) => setEmail(e.target.value), type: "email", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Email", disabled: isEditMode })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Moblie Number" }), _jsx("input", { required: true, value: mobile, onChange: (e) => setMobile(e.target.value), type: "number", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Enter Mobile Number" })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsx("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: "Address" }), _jsx("input", { required: true, value: address, onChange: (e) => setAddress(e.target.value), type: "text", className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", placeholder: "Address" })] }), _jsxs("div", { className: "mb-6 w-full", children: [_jsxs("label", { className: "text-gray-900 dark:text-gray-200 font-semibold", children: ["Role Type ", _jsx("span", { className: "text-red-500", children: "*" })] }), _jsxs("select", { required: true, value: roleType, onChange: (e) => setRoleType(e.target.value), className: "w-full px-4 py-2 mt-2 text-gray-800 bg-white border border-gray-400 rounded-md dark:bg-gray-800 dark:text-gray-300 dark:border-gray-800 focus:border-blue-400 focus:ring-blue-300 focus:ring-opacity-40 dark:focus:border-blue-300 focus:outline-none focus:ring", children: [_jsx("option", { value: "", children: "Select a Role Type" }), _jsx("option", { value: "1", children: "Guest" }), _jsx("option", { value: "2", children: "Admin" })] })] }), _jsxs("div", { className: "flex space-x-4 mt-6 justify-end", children: [_jsx("button", { type: "submit", onClick: handleSubmit, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: isEditMode ? "Edit" : "Add" }), _jsx("button", { type: "button", onClick: handleCancelClick, className: "px-8 py-2.5 leading-5 text-white transition-colors duration-300 transform bg-blue-600 rounded-md hover:bg-blue-500 focus:outline-none focus:bg-gray-600", children: "Cancel" })] })] }) }) }));
|
110
110
|
};
|
@@ -64,8 +64,6 @@ function Users() {
|
|
64
64
|
window.location.href = `/admin/users/userform?id=${user.id}`; // Manually navigate
|
65
65
|
}, children: _jsx("button", { className: "text-gray-500 transition-colors duration-200 dark:hover:text-yellow-500 dark:text-gray-300 hover:text-yellow-500 focus:outline-none", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: "1.5", stroke: "currentColor", className: "w-5 h-5", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10" }) }) }) })] }) }), _jsx("td", { className: "px-4 py-4 text-sm font-medium text-gray-700 whitespace-nowrap", children: _jsx("div", { className: "inline-flex items-center gap-x-3", children: _jsx("div", { className: "flex items-center gap-x-2", children: _jsx("div", { children: _jsx("h2", { className: " text-sm font-medium text-gray-800 dark:text-white ", children: user.name }) }) }) }) }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.email }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: (user === null || user === void 0 ? void 0 : user.mobile) || "Not Provided" }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: (user === null || user === void 0 ? void 0 : user.address) || "Not Provided" }), _jsx("td", { className: "px-4 py-4 text-sm text-gray-500 dark:text-gray-300 whitespace-nowrap", children: user.roleType === "1" ? "Guest" : "Admin" })] }, user.id || index))) })] }) }), _jsxs("div", { className: "flex items-center justify-between mt-6", children: [_jsxs("button", { onClick: handlePreviousPage, disabled: currentPage === 1, className: "flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6.75 15.75L3 12m0 0l3.75-3.75M3 12h18" }) }), _jsx("span", { children: "previous" })] }), _jsx("div", { className: "items-center hidden lg:flex gap-x-3", children: Array.from({ length: totalPages }, (_, index) => (_jsx("button", { onClick: () => handlePageClick(index + 1), className: `px-2 py-1 text-sm ${currentPage === index + 1
|
66
66
|
? "text-blue-500 bg-blue-100"
|
67
|
-
: "text-gray-500 hover:bg-gray-100"} rounded-md`, children: index + 1 }, index + 1))) }), _jsxs("button", { onClick: handleNextPage, disabled: currentPage === totalPages, className: "flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800", children: [_jsx("span", { children: "Next" }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3" }) })] })] }), _jsx("div", { className: "flex-grow ml-0 mt-4 w-0", children: _jsxs("button", { type: "button", onClick: () => {
|
68
|
-
window.history.pushState({}, "", "/admin/users/userform");
|
69
|
-
}, className: "flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80", children: [_jsx(FaPlus, { className: "mr-2 font-medium" }), "User"] }) })] })] }));
|
67
|
+
: "text-gray-500 hover:bg-gray-100"} rounded-md`, children: index + 1 }, index + 1))) }), _jsxs("button", { onClick: handleNextPage, disabled: currentPage === totalPages, className: "flex items-center px-5 py-2 text-sm text-gray-700 capitalize transition-colors duration-200 bg-white border rounded-md gap-x-2 hover:bg-gray-100 dark:bg-gray-900 dark:text-gray-200 dark:border-gray-700 dark:hover:bg-gray-800", children: [_jsx("span", { children: "Next" }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "w-5 h-5 rtl:-scale-x-100", children: _jsx("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3" }) })] })] }), _jsx("div", { className: "flex-grow ml-0 mt-4 w-0", children: _jsxs("button", { type: "button", onClick: () => (window.location.href = "/admin/users/userform"), className: "flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80", children: [_jsx(FaPlus, { className: "mr-2 font-medium" }), "User"] }) })] })] }));
|
70
68
|
}
|
71
69
|
export default Users;
|
package/package.json
CHANGED
@@ -299,14 +299,9 @@ const Taxionomies = () => {
|
|
299
299
|
</a> */}
|
300
300
|
<button
|
301
301
|
type="button"
|
302
|
-
onClick={() =>
|
303
|
-
window.
|
304
|
-
|
305
|
-
"",
|
306
|
-
"/admin/taxinomies/taxonomyform"
|
307
|
-
);
|
308
|
-
// Add any logic here to handle rendering the new content
|
309
|
-
}}
|
302
|
+
onClick={() =>
|
303
|
+
(window.location.href = "/admin/taxinomies/taxonomyform")
|
304
|
+
}
|
310
305
|
className="flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80"
|
311
306
|
>
|
312
307
|
<FaPlus className="mr-2 font-medium" />
|
@@ -207,14 +207,12 @@ const TaxonomyForm = () => {
|
|
207
207
|
}
|
208
208
|
}, [type]);
|
209
209
|
|
210
|
-
// Check if the current pathname matches "/taxonomy/taxonomyform"
|
211
210
|
useEffect(() => {
|
212
211
|
if (window.location.pathname === "/taxinomies/taxonomyform") {
|
213
212
|
setIsSimilarTaxonomyOpen(true);
|
214
213
|
}
|
215
214
|
}, []);
|
216
215
|
|
217
|
-
// Handle form submission
|
218
216
|
const handleSubmit = async (event: React.MouseEvent<HTMLButtonElement>) => {
|
219
217
|
event.preventDefault();
|
220
218
|
if (!validateForm()) return;
|
@@ -91,7 +91,7 @@ const UserForm = () => {
|
|
91
91
|
await addUserApi(userName, email, mobile, address, roleType);
|
92
92
|
alert("User added successfully");
|
93
93
|
}
|
94
|
-
window.location.href = "/admin/
|
94
|
+
window.location.href = "/admin/users";
|
95
95
|
} catch (error) {
|
96
96
|
console.error("Error adding/updating User:", error);
|
97
97
|
alert("Failed to add/update User");
|
@@ -113,7 +113,7 @@ const UserForm = () => {
|
|
113
113
|
setMobile("");
|
114
114
|
setAddress("");
|
115
115
|
setRoleType("");
|
116
|
-
window.location.href = "/admin/
|
116
|
+
window.location.href = "/admin/users";
|
117
117
|
};
|
118
118
|
|
119
119
|
return (
|
@@ -342,9 +342,7 @@ function Users() {
|
|
342
342
|
</a> */}
|
343
343
|
<button
|
344
344
|
type="button"
|
345
|
-
onClick={() =>
|
346
|
-
window.history.pushState({}, "", "/admin/users/userform");
|
347
|
-
}}
|
345
|
+
onClick={() => (window.location.href = "/admin/users/userform")}
|
348
346
|
className="flex items-center justify-center px-6 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-300 transform bg-blue-600 rounded-lg hover:bg-blue-500 focus:outline-none focus:ring focus:ring-blue-300 focus:ring-opacity-80"
|
349
347
|
>
|
350
348
|
<FaPlus className="mr-2 font-medium" />
|