integrated activity api and fetch in master seaction.

This commit is contained in:
Pramod Mahajan 2025-04-10 03:03:38 +05:30
parent 4a5d9c05e6
commit 2428f15f35
4 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
export const mastersList = [{id:1, name: "Role"},{id:2, name: "Job Role"}]
export const mastersList = [{id:1, name: "Role"},{id:2, name: "Job Role"},{id:3,name:"Activity"}]
export const dailyTask = [
{

View File

@ -43,8 +43,9 @@ const useMaster = () => {
response = await MasterRespository.getJobRole();
response = response.data
break;
case "Module":
response = [{description: null,module:"Module 1",featurePermission: null,id: "08dd4761-363c-49ed-8851-3d2489a3e98d"},{description: null,module:"Module 2",featurePermission: null,id: "08dy9761-363c-49ed-8851-3d2489a3e98d"},{description: null,module:"Module 3",featurePermission: null,id: "08dy7761-263c-49ed-8851-3d2489a3e98d"}];
case "Activity":
response = await MasterRespository.getActivites();
response = response.data
break;
case "Status":
response = [{description: null,featurePermission: null,id: "02dd4761-363c-49ed-8851-3d2489a3e98d",status:"status 1"},{description: null,featurePermission: null,id: "03dy9761-363c-49ed-8851-3d2489a3e98d",status:"status 2"},{description: null,featurePermission: null,id: "03dy7761-263c-49ed-8851-3d2489a3e98d",status:"Status 3"}];

View File

@ -28,7 +28,7 @@ const MasterTable = ( {data, columns, loading, handleModalData} ) =>
.map((col) => ({
...col,
label:
col.key === "role" || col.key === "module" || col.key === "status" ? "Name" : col.label,
col.key === "role" || col.key === "Activity" || col.key === "status" ? "Name" : col.label,
}));
return (
@ -46,7 +46,7 @@ const MasterTable = ( {data, columns, loading, handleModalData} ) =>
<tr>
<th></th>
<th>{ selectedMaster} Name</th>
<th>{selectedMaster } Description</th>
<th>{selectedMaster} {selectedMaster === "Activity" ? "Unit":"Description" }</th>
<th className={` ${!hasMasterPermission && 'd-none'}`}>Actions</th>
</tr>
</thead>

View File

@ -27,7 +27,9 @@ export const MasterRespository = {
createJobRole:(data)=>api.post('api/roles/jobrole',data),
getJobRole :()=>api.get("/api/roles/jobrole"),
updateJobRole:(id,data)=>api.put(`/api/roles/jobrole/${id}`,data)
updateJobRole: ( id, data ) => api.put( `/api/roles/jobrole/${ id }`, data ),
getActivites: () => api.get( 'api/task/activities' ),
}