update enviroment variable

This commit is contained in:
PramodMahajan14 2025-03-29 14:36:57 +05:30
parent 66bfcd80c1
commit 850b2e6998
6 changed files with 34 additions and 17 deletions

View File

@ -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 && (
<div

View File

@ -114,7 +114,7 @@ const ManageRole = ({employeeId,onClosed}) => {
</div>
<div className='d-flex flex-wrap justify-content-between align-items-center pb-5 ' style={{height: "70vh", overflowY: "scroll"}} >
<div className='d-flex flex-wrap justify-content-between align-items-center pb-5 ' style={{maxHeight: "70vh", overflowY: "scroll"}} >
{(loading || roleLoading) && <p>Loading...</p>}
{data && data.map((item) => (
@ -155,11 +155,7 @@ const ManageRole = ({employeeId,onClosed}) => {
Cancel
</button>
</div>
</form>
</form>
</div>
</div>
</div>

View File

@ -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)
})

View File

@ -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)
})
};

View File

@ -57,12 +57,26 @@ const MasterTable = ( {data, columns, loading, handleModalData} ) =>
currentItems.map((item, index) => (
<tr key={index}>
<td></td>
{updatedColumns.map((col) => (
{updatedColumns.map( ( col ) => (
<td className="text-start mx-2" key={col.key}>
{item[col.key] !== undefined && item[col.key] !== null
? item[col.key]
: " --- "}
</td>
{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] : " --- "
)}
</td>
))}
<td >
{/* className={` ${hasUserPermission('660131a4-788c-4739-a082-cbbf7879cbf2') ? "":"d-none"}`}> */}

View File

@ -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',
},
},