diff --git a/src/components/Employee/ManageEmployee.jsx b/src/components/Employee/ManageEmployee.jsx
index 9d74463c..ddec36f1 100644
--- a/src/components/Employee/ManageEmployee.jsx
+++ b/src/components/Employee/ManageEmployee.jsx
@@ -23,7 +23,8 @@ const ManageEmployee = () => {
error,
loading: empLoading,
} = useEmployeeProfile(employeeId);
- dispatch(changeMaster("Job Role"));
+ dispatch( changeMaster( "Job Role" ) );
+ const [disabledEmail,setDisabledEmail] = useState(false)
const { data: job_role, loading } = useMaster();
const [isloading, setLoading] = useState(false);
const navigation = useNavigate();
@@ -219,6 +220,7 @@ const ManageEmployee = () => {
}
: {} // Empty object resets the form
);
+ // if(currentEmployee && currentEmployee.email) setDisabledEmail(true)
}, [currentEmployee, reset]);
console.log(currentEmployee);
@@ -312,6 +314,7 @@ const ManageEmployee = () => {
placeholder="Email"
aria-label=""
aria-describedby="Email"
+ disabled={!!currentEmployee?.email}
/>
{errors.Email && (
{
-
+
{(loading || roleLoading) &&
Loading...
}
{data && data.map((item) => (
@@ -155,11 +155,7 @@ const ManageRole = ({employeeId,onClosed}) => {
Cancel
-
-
-
-
-
+
diff --git a/src/components/master/CreateRole.jsx b/src/components/master/CreateRole.jsx
index 71b7b730..c9e4f8b6 100644
--- a/src/components/master/CreateRole.jsx
+++ b/src/components/master/CreateRole.jsx
@@ -66,8 +66,10 @@ const onSubmit = (values) => {
cacheData("Role", updatedData);
showToast("Role Added successfully.", "success");
onClose()
- }).catch((err)=>{
- showToast(err.message, "error");
+ } ).catch( ( err ) =>
+ {
+
+ showToast(err?.response?.data?.message, "error");
setIsLoading(false)
})
diff --git a/src/components/master/EditRole.jsx b/src/components/master/EditRole.jsx
index f8903490..6750082b 100644
--- a/src/components/master/EditRole.jsx
+++ b/src/components/master/EditRole.jsx
@@ -110,10 +110,12 @@ const EditMaster=({master,onClose})=> {
cacheData("Role", updatedData);
}
- showToast("Role Update successfully.", "success");
+ showToast( "Role Update successfully.", "success" );
+ setIsLoading(false)
onClose()
}).catch((Err)=>{
- showToast(Err.message, "error");
+ showToast( Err.message, "error" );
+ setIsLoading(false)
})
};
diff --git a/src/pages/master/MasterTable.jsx b/src/pages/master/MasterTable.jsx
index 5e730534..6d01935d 100644
--- a/src/pages/master/MasterTable.jsx
+++ b/src/pages/master/MasterTable.jsx
@@ -57,12 +57,26 @@ const MasterTable = ( {data, columns, loading, handleModalData} ) =>
currentItems.map((item, index) => (
|
- {updatedColumns.map((col) => (
+ {updatedColumns.map( ( col ) => (
- {item[col.key] !== undefined && item[col.key] !== null
- ? item[col.key]
- : " --- "}
- |
+ {col.key === "description" ? (
+ item[col.key] !== undefined && item[col.key] !== null ? (
+ item[col.key].length > 80 ? (
+ <>
+ {item[col.key].slice(0, 80)}...
+ >
+ ) : (
+ item[col.key]
+ )
+ ) : (
+ " --- "
+ )
+ ) : (
+ item[col.key] !== undefined && item[col.key] !== null ? item[col.key] : " --- "
+ )}
+
+
+
))}
{/* className={` ${hasUserPermission('660131a4-788c-4739-a082-cbbf7879cbf2') ? "":"d-none"}`}> */}
diff --git a/vite.config.ts b/vite.config.ts
index d66b0976..b5b23fd9 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -12,7 +12,7 @@ export default defineConfig({
},
define: {
'process.env': {
- VITE_BASE_URL: process.env.VITE_BASE_URL || 'http://localhost:8080',
+ VITE_BASE_URL: process.env.VITE_BASE_URL || 'http://localhost:5032',
},
},
|