Merge branch 'Issue_May_2W' of https://git.marcoaiot.com/admin/marco.pms.web into pramod_Bug#141
This commit is contained in:
commit
13fb930a77
@ -194,7 +194,8 @@ const ManageEmployee = () => {
|
||||
navigation("/employees");
|
||||
})
|
||||
.catch((error) => {
|
||||
showToast(error.message, "error");
|
||||
const message = error?.response?.data?.message || error?.message || "Error occured during api calling"
|
||||
showToast(message, "error");
|
||||
setLoading(false);
|
||||
});
|
||||
};
|
||||
|
@ -157,9 +157,9 @@ const ManageRole = ( {employeeId, onClosed} ) =>
|
||||
reset();
|
||||
onClosed();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
showToast(err.message, "error");
|
||||
.catch((error) => {
|
||||
const message = error?.response?.data?.message || error?.message || "Error occured during api calling"
|
||||
showToast(message, "error");
|
||||
setIsLoading(false);
|
||||
});
|
||||
};
|
||||
|
@ -110,6 +110,7 @@ const TaskModel = ({
|
||||
await onSubmit(data);
|
||||
setValue("plannedWork", 0);
|
||||
setValue( "completedWork", 0 );
|
||||
setValue("activityID",0)
|
||||
setIsSubmitting(false);
|
||||
};
|
||||
|
||||
@ -246,7 +247,7 @@ const TaskModel = ({
|
||||
|
||||
{selectedWorkArea && (
|
||||
<div className="col-12 col-md-12">
|
||||
<label className="form-label" htmlFor="activityID">
|
||||
<label className="form-label" >
|
||||
Select Activity
|
||||
</label>
|
||||
<select
|
||||
|
@ -28,7 +28,10 @@ const ManageProjectInfo = ({ project, handleSubmitForm, onClose }) => {
|
||||
name: z.string().min(1, { message: "Project Name is required" }),
|
||||
contactPerson: z
|
||||
.string()
|
||||
.min(1, { message: "Contact Person Name is required" }),
|
||||
.min( 1, {message: "Contact Person Name is required"} )
|
||||
.regex(/^[A-Za-z\s]+$/, {
|
||||
message: "Contact Person must contain only letters",
|
||||
}),
|
||||
projectAddress: z
|
||||
.string()
|
||||
.min(1, { message: "Address is required" })
|
||||
@ -156,6 +159,7 @@ const ManageProjectInfo = ({ project, handleSubmitForm, onClose }) => {
|
||||
name="contactPerson"
|
||||
className="form-control"
|
||||
placeholder="Contact Person"
|
||||
maxLength={50}
|
||||
{...register("contactPerson")}
|
||||
/>
|
||||
{errors.contactPerson && (
|
||||
|
@ -49,11 +49,10 @@ const EmployeeList = () => {
|
||||
|
||||
if (!employeeList.length) return;
|
||||
|
||||
const results = employeeList.filter((item) =>
|
||||
Object.values(item).some(
|
||||
(field) => field && field.toString().toLowerCase().includes(value)
|
||||
)
|
||||
);
|
||||
const results = employeeList.filter((item) => {
|
||||
const fullName = `${item.firstName} ${item.lastName}`.toLowerCase();
|
||||
return fullName.includes(value);
|
||||
});
|
||||
|
||||
setFilteredData(results);
|
||||
};
|
||||
@ -557,7 +556,7 @@ const EmployeeList = () => {
|
||||
>
|
||||
<i className="bx bx-edit bx-sm"></i> Edit
|
||||
</Link>
|
||||
<button
|
||||
{!item.isSystem && (<><button
|
||||
className="dropdown-item py-1"
|
||||
onClick={() => suspendEmployee(item.id)}
|
||||
>
|
||||
@ -573,7 +572,7 @@ const EmployeeList = () => {
|
||||
>
|
||||
<i className="bx bx-cog bx-sm"></i> Manage
|
||||
Role
|
||||
</button>
|
||||
</button></>)}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
@ -25,7 +25,7 @@ const ProjectList = () => {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const [itemsPerPage] = useState(6);
|
||||
const [itemsPerPage] = useState(10);
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
const [selectedStatuses, setSelectedStatuses] = useState([
|
||||
"b74da4c2-d07e-46f2-9919-e75e49b12731",
|
||||
|
@ -15,7 +15,7 @@ export const RolesRepository = {
|
||||
|
||||
|
||||
getEmployeeRoles:(id)=>api.get(`/api/employee/roles/${id}`),
|
||||
createEmployeeRoles:(data)=>api.post("/api/employee/roles",data)
|
||||
createEmployeeRoles:(data)=>api.post("/api/roles/assign-roles",data)
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user