Compare commits

..

No commits in common. "99d8be1e4bf7b69abde0c7f661b2cfcb3a24add7" and "d74854b847b4cca2ce8f86eeaf82514b266659de" have entirely different histories.

19 changed files with 138 additions and 208 deletions

View File

@ -112,7 +112,7 @@ const AttendanceLog = ({ handleModalData, projectId, showOnlyCheckout }) => {
const { currentPage, totalPages, currentItems: paginatedAttendances, paginate, resetPage } = usePagination(
processedData,
20
10
);
// Reset to the first page whenever processedData changes (due to switch on/off)
@ -127,7 +127,7 @@ const AttendanceLog = ({ handleModalData, projectId, showOnlyCheckout }) => {
id="DataTables_Table_0_length"
>
<div className="col-md-3 my-0 ">
<DateRangePicker onRangeChange={setDateRange} defaultStartDate={yesterday} />
<DateRangePicker onRangeChange={setDateRange} defaultStartDate={yesterday} />
</div>
<div className="col-md-2 m-0 text-end">
<i
@ -171,7 +171,7 @@ const AttendanceLog = ({ handleModalData, projectId, showOnlyCheckout }) => {
acc.push(
<tr key={`header-${currentDate}`} className="table-row-header">
<td colSpan={6} className="text-start">
<strong>{moment(currentDate).format("DD-MM-YYYY")}</strong>
<strong>{moment(currentDate).format("YYYY-MM-DD")}</strong>
</td>
</tr>
);

View File

@ -1,4 +1,4 @@
import React, { useState,useEffect } from "react";
import React, { useState } from "react";
import { formatDate } from "../../utils/dateUtils";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
@ -13,23 +13,15 @@ export const ReportTask = ({ report, closeModal, refetch }) => {
report?.workItem?.plannedWork - report?.workItem?.completedWork;
const schema = z.object({
completedTask: z
.preprocess(
(val) => (val === "" || val === null || Number.isNaN(val) ? undefined : Number(val)),
z
.number({
required_error: "Completed Work must be a number",
invalid_type_error: "Completed Work must be a number",
})
.min(1, "Completed Work must be greater than 0")
.max(maxPending, {
message: `Completed task cannot exceed total pending tasks: ${maxPending}`,
})
),
comment: z.string().min(1, "Comment cannot be empty"),
});
completedTask: z
.number()
.min(0, "Completed Work must be greater than 0")
.max(maxPending, {
message: `Completed task cannot exceed total pending tasks: ${maxPending}`,
})
.optional(),
comment: z.string().min(1, "Comment cannot be empty"),
});
const {
register,
handleSubmit,
@ -40,14 +32,6 @@ export const ReportTask = ({ report, closeModal, refetch }) => {
defaultValues: { completedTask: 0, comment: "" },
});
useEffect(() => {
if (report) {
reset({ completedTask: 0, comment: "" }); // optional: customize default if needed
}
}, [report, reset]);
const onSubmit = async (data) => {
try {
setloading(true);
@ -72,7 +56,6 @@ useEffect(() => {
};
const handleClose = () => {
closeModal();
reset();
};
return (

View File

@ -13,52 +13,35 @@ const schema = z.object({
comment: z.string().min(1, "Comment cannot be empty"),
});
/**
* ReportTaskComments component for displaying and adding comments to a task.
* It also shows a summary of the activity and task details.
*
* @param {object} props - The component props.
* @param {object} props.commentsData - Data related to the task and its comments, including the description.
* @param {function} props.closeModal - Callback function to close the modal.
*/
const ReportTaskComments = ({ commentsData, closeModal }) => {
const [loading, setloading] = useState(false);
const [comments, setComment] = useState([]);
const [bgClass, setBgClass] = useState("");
const {
register,
handleSubmit,
formState: { errors },
reset, // Destructure reset from useForm
reset,
} = useForm({
resolver: zodResolver(schema),
});
const containerRef = useRef(null);
const firstRender = useRef(true);
const firstRender = useRef(true);
useEffect(() => {
const taskList = getCachedData("taskList");
if (taskList && taskList.data && commentsData?.id) {
const currentTask = taskList.data.find(task => task.id === commentsData.id);
if (currentTask && currentTask.comments) {
setComment(currentTask.comments);
} else {
setComment(commentsData?.comments || []);
}
} else {
setComment(commentsData?.comments || []);
}
firstRender.current = true;
setComment(commentsData?.comments);
}, [commentsData]);
// Scroll logic: scroll to bottom when new comments are added
useEffect(() => {
if (!firstRender.current && containerRef.current) {
containerRef.current.scrollTop = containerRef.current.scrollHeight;
} else {
firstRender.current = false;
firstRender.current = false; // Mark the first render as complete
}
}, [comments]);
}, [comments]); // Run this when comments array is updated
const onSubmit = async (data) => {
let sendComment = {
@ -69,34 +52,28 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
try {
setloading(true);
const resp = await TasksRepository.taskComments(sendComment);
setComment((prevItems) => [...prevItems, resp.data]);
const taskList = getCachedData("taskList");
if (taskList && taskList.data) {
const updatedTaskList = taskList.data.map((task) => {
if (task.id === resp.data.taskAllocationId) {
const existingComments = Array.isArray(task.comments)
? task.comments
: [];
return {
...task,
comments: [...existingComments, resp.data],
};
}
return task;
});
cacheData("taskList", {
data: updatedTaskList,
projectId: taskList.projectId,
});
}
reset();
const updatedTaskList = taskList.data.map((task) => {
if (task.id === resp.data.taskAllocationId) {
const existingComments = Array.isArray(task.comments)
? task.comments
: [];
return {
...task,
comments: [...existingComments, resp.data],
};
}
return task;
});
cacheData("taskList", {
data: updatedTaskList,
projectId: taskList.projectId,
});
reset();
setloading(false);
showToast("Successfully Sent", "success");
// closeModal();
} catch (error) {
setloading(false);
showToast(error.response.data?.message || "Something went wrong", "error");
@ -116,20 +93,16 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
onClick={closeModal}
aria-label="Close"
></button>
<h5 className=" text-center mb-2">
Activity Summary
</h5>
<p className="fs-6 text-dark text-start m-0">Activity Summary</p>
<p className="small-text text-start my-2">
{commentsData?.workItem?.workArea?.floor?.building?.description}
{comments && comments[0]?.comment}
</p>
<p className="fw-bold my-2 text-start">
Assigned By :
<span className=" ms-2">
{commentsData?.assignedBy?.firstName +
{commentsData?.assignedBy.firstName +
" " +
commentsData?.assignedBy?.lastName}
commentsData?.assignedBy.lastName}
</span>{" "}
</p>
@ -153,7 +126,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
Completed Work : {commentsData?.completedTask}
</p>
<div className="d-flex align-items-center flex-wrap">
<p className="fw-bold text-start m-0 me-1">Team :</p>
<p className="fw-bold text-start m-0 me-1">Team:</p>
<div className="d-flex flex-wrap align-items-center gap-2">
{commentsData?.teamMembers?.map((member, idx) => (
<span key={idx} className="d-flex align-items-center">
@ -174,6 +147,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
{...register("comment")}
className="form-control"
id="exampleFormControlTextarea1"
rows="1"
placeholder="Enter comment"
/>
{errors.comment && (
@ -188,7 +162,7 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
>
Close
</button>
<button type="submit" className="btn btn-sm btn-primary ms-2" disabled={loading}>
<button type="submit" className="btn btn-sm btn-primary ms-2">
{loading ? "Sending..." : "Comment"}
</button>
</div>
@ -196,21 +170,23 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
<ul
className="list-group px-0 mx-0 overflow-auto border-0"
ref={containerRef}
// ref={containerRef} // auto scroll according data
style={{ maxHeight: "200px" }}
>
{comments &&
comments
?.slice()
.reverse()
.reverse()
.map((data, idx) => {
const fullName = `${data?.employee?.firstName} ${data?.employee?.lastName}`;
const bgClass = getBgClassFromHash(fullName);
return (
<li
className={`list-group-item list-group-item-action border-none my-1 p-1`}
key={idx}
>
<div
className={`li-wrapper d-flex justify-content-start align-items-center my-0`}
className={`li-wrapper d-flex justify-content-start align-items-start my-0`}
>
<div className="avatar avatar-xs me-1">
<span
@ -220,9 +196,9 @@ const ReportTaskComments = ({ commentsData, closeModal }) => {
</span>
</div>
<div className={`d-flex align-items-center justify-content-start`}>
<p className={`mb-0 text-muted me-2`}>{fullName}</p>
<p className={`text-secondary m-0`} style={{ fontSize: "10px" }}>
<div className={`text-start py-0`}>
<p className={`mb-0 text-${bgClass}`}>{fullName}</p>
<p className="text-muted m-0" style={{ fontSize: "10px" }}>
{moment.utc(data?.commentDate).local().fromNow()}
</p>
</div>

View File

@ -79,10 +79,10 @@ const CardViewDirectory = ({
)}
{!IsActive && (
<i
className={`bx ${
className={`bx bx-history ${
dirActions.action && dirActions.id === contact.id
? "bx-loader-alt bx-spin"
: "bx-recycle"
? "bx-spin"
: ""
} me-1 text-primary cursor-pointer`}
title="Restore"
onClick={() => {

View File

@ -110,9 +110,8 @@ const ListViewDirectory = ({
)}
{!IsActive && (
<i
className={`bx ${
dirActions.action && dirActions.id === contact.id ? "bx-loader-alt bx-spin"
: "bx-recycle"
className={`bx bx-history ${
dirActions.action && dirActions.id === contact.id ? "bx-spin" : ""
} me-1 text-primary cursor-pointer`}
title="Restore"
onClick={() => {
@ -126,4 +125,4 @@ const ListViewDirectory = ({
);
};
export default ListViewDirectory;
export default ListViewDirectory;

View File

@ -296,7 +296,7 @@ const ManageBucket = () =>
<tbody className="table-border-bottom-0 overflow-auto">
{loading && (
<tr className="mt-10">
<td colSpan={5}>
<td colSpan={4}>
{" "}
<div className="d-flex justify-content-center align-items-center py-5">
Loading...
@ -306,7 +306,7 @@ const ManageBucket = () =>
)}
{!loading && buckets.length == 0 && (
<tr>
<td colSpan={5}>
<td colSpan={4}>
<div className="d-flex justify-content-center align-items-center py-5">
Bucket Not Available.
</div>
@ -315,7 +315,7 @@ const ManageBucket = () =>
)}
{!loading && sortedBucktesList.length == 0 && (
<tr>
<td className="text-center py-4 h-25" colSpan={5}>
<td className="text-center py-4 h-25" colSpan={4}>
<div className="d-flex justify-content-center align-items-center py-5">
No Matching Bucket Found.
</div>

View File

@ -156,16 +156,15 @@ const NoteCardDirectory = ({refetchProfile,refetchNotes, noteItem, contactId, se
)}
</>
) : isActivProcess ? (
< i className='bx bx-loader-alt bx-spin text-primary' ></i>
< i className='bx bx-refresh text-primary bx-spin' ></i>
) : (
<i
className="bx bx-recycle me-1 text-primary cursor-pointer"
className="bx bx-history me-1 text-primary cursor-pointer"
onClick={() => handleDeleteNote(!noteItem.isActive)}
title="Restore"
></i>
)}
</div>
</div>
</div>

View File

@ -273,6 +273,13 @@ const AssignRoleModel = ({ assignData, onClose }) => {
</div>
</div>
{employeeLoading && <div>Loading employees...</div>}
{!employeeLoading &&
filteredEmployees?.length === 0 &&
employees && (
<div>No employees found for the selected role.</div>
)}
<div className="row">
<div className="col-12 h-sm-25 overflow-auto mt-2">
{selectedRole !== "" && (

View File

@ -102,21 +102,13 @@ const ManageProjectInfo = ({ project, handleSubmitForm, onClose }) => {
const onSubmitForm = (updatedProject) => {
setLoading(true);
handleSubmitForm( updatedProject, setLoading,reset );
};
const handleCancel = () => {
reset({
id: project?.id || "",
name: project?.name || "",
contactPerson: project?.contactPerson || "",
projectAddress: project?.projectAddress || "",
startDate: formatDate(project?.startDate) || currentDate,
endDate: formatDate(project?.endDate) || currentDate,
projectStatusId: String(project?.projectStatusId || "00000000-0000-0000-0000-000000000000"),
});
onClose();
};
return (
<div
className="modal-dialog modal-lg modal-simple mx-sm-auto mx-1 edit-project-modal"
@ -127,7 +119,7 @@ const ManageProjectInfo = ({ project, handleSubmitForm, onClose }) => {
<button
type="button"
className="btn-close"
onClick={handleCancel}
onClick={onClose}
aria-label="Close"
></button>
<div className="text-center mb-2">
@ -288,7 +280,7 @@ const ManageProjectInfo = ({ project, handleSubmitForm, onClose }) => {
<button
type="button"
className="btn btn-sm btn-label-secondary"
onClick={handleCancel}
onClick={onClose}
aria-label="Close"
>
Cancel

View File

@ -1,13 +1,10 @@
import React from "react";
import { hasUserPermission } from "../../utils/authUtils";
import { useHasUserPermission } from "../../hooks/useHasUserPermission";
import { DIRECTORY_ADMIN, DIRECTORY_MANAGER, DIRECTORY_USER, VIEW_PROJECT_INFRA } from "../../utils/constants";
import { VIEW_PROJECT_INFRA } from "../../utils/constants";
const ProjectNav = ({ onPillClick, activePill }) => {
const HasViewInfraStructure = useHasUserPermission( VIEW_PROJECT_INFRA );
const DirAdmin = useHasUserPermission(DIRECTORY_ADMIN);
const DireManager = useHasUserPermission(DIRECTORY_MANAGER)
const DirUser = useHasUserPermission(DIRECTORY_USER)
const HasViewInfraStructure = useHasUserPermission(VIEW_PROJECT_INFRA);
return (
<div className="nav-align-top">
@ -76,8 +73,7 @@ const ProjectNav = ({ onPillClick, activePill }) => {
<i className="bx bxs-file-image bx-sm me-1_5"></i> <span className="d-none d-md-inline">Image Gallary</span>
</a>
</li>
{DirAdmin || DireManager || DirUser && (
<li className="nav-item">
<li className="nav-item">
<a
className={`nav-link ${activePill === "directory" ? "active" : ""}`}
href="#"
@ -89,8 +85,6 @@ const ProjectNav = ({ onPillClick, activePill }) => {
<i className='bx bxs-contact bx-sm me-1_5'></i> <span className="d-none d-md-inline">Directory</span>
</a>
</li>
)}
</ul>
</div>
);

View File

@ -12,7 +12,7 @@ const DateRangePicker = ({ onRangeChange, DateDifference = 7, defaultStartDate =
const fp = flatpickr(inputRef.current, {
mode: "range",
dateFormat: "d-m-Y",
dateFormat: "Y-m-d",
defaultDate: [fifteenDaysAgo, today],
static: true,
clickOpens: true,

View File

@ -13,7 +13,7 @@ const FloatingMenu = () => {
actions.map((action, index) => (
<button
key={index}
className={`badge bg-${action.color} rounded-pill mb-2 d-inline-flex align-items-center gap-2 px-3 py-1 cursor-pointer fab-option`}
className={`badge bg-label-${action.color} rounded-pill mb-2 d-inline-flex align-items-center gap-2 px-3 py-1 cursor-pointer fab-option`}
onClick={action.onClick}
title={action.label}
>

View File

@ -66,7 +66,7 @@
},
{
"text": "Directory",
"icon": "bx bx-group",
"icon": "bx bx-folder",
"available": true,
"link": "/directory"
},

View File

@ -2,7 +2,7 @@ import { useEffect, useState } from "react";
import { DirectoryRepository } from "../repositories/DirectoryRepository";
import { cacheData, getCachedData } from "../slices/apiDataManager";
export const useDirectory = (isActive,prefernceContacts) => {
export const useDirectory = (isActive) => {
const [contacts, setContacts] = useState([]);
const [loading, setLoading] = useState(false);
const [error, setError] = useState(null);
@ -10,7 +10,7 @@ export const useDirectory = (isActive,prefernceContacts) => {
const fetch = async (activeParam = isActive) => {
setLoading(true);
try {
const response = await DirectoryRepository.GetContacts(activeParam,prefernceContacts);
const response = await DirectoryRepository.GetContacts(activeParam);
setContacts(response.data);
cacheData("contacts", { data: response.data, isActive: activeParam });
} catch (error) {
@ -22,12 +22,12 @@ export const useDirectory = (isActive,prefernceContacts) => {
useEffect(() => {
const cachedContacts = getCachedData("contacts");
if (!cachedContacts?.data || cachedContacts.isActive !== isActive || prefernceContacts) {
fetch(isActive,prefernceContacts);
if (!cachedContacts?.data || cachedContacts.isActive !== isActive) {
fetch(isActive);
} else {
setContacts(cachedContacts.data);
}
}, [isActive,prefernceContacts]);
}, [isActive]);
return {
contacts,

View File

@ -6,7 +6,7 @@ import { useTaskList } from "../../hooks/useTasks";
import { useProjects } from "../../hooks/useProjects";
import { setProjectId } from "../../slices/localVariablesSlice";
import { useProfile } from "../../hooks/useProfile";
// import { formatDate } from "../../utils/dateUtils"; // Removed this import
import { formatDate } from "../../utils/dateUtils";
import GlobalModel from "../../components/common/GlobalModel";
import AssignRoleModel from "../../components/Project/AssignRole";
import { ReportTask } from "../../components/Activities/ReportTask";
@ -14,7 +14,6 @@ import ReportTaskComments from "../../components/Activities/ReportTaskComments";
import DateRangePicker from "../../components/common/DateRangePicker";
import DatePicker from "../../components/common/DatePicker";
import { useSearchParams } from "react-router-dom";
import moment from "moment";
const DailyTask = () => {
const [searchParams] = useSearchParams();
@ -142,7 +141,6 @@ const DailyTask = () => {
<DateRangePicker
onRangeChange={setDateRange}
DateDifference="6"
dateFormat="DD-MM-YYYY"
/>
</div>
<div className="col-sm-3 col-6 text-end mb-1">
@ -190,7 +188,7 @@ const DailyTask = () => {
</tr>
)}
{!task_loading && TaskList.length === 0 && (
<tr>
<tr>
<td colSpan={7} className="text-center">
<p>No Reports Found</p>
</td>
@ -201,7 +199,7 @@ const DailyTask = () => {
<React.Fragment key={i}>
<tr className="table-row-header">
<td colSpan={7} className="text-start">
<strong>{moment(date).format("DD-MM-YYYY")}</strong>
<strong>{date}</strong>
</td>
</tr>
{TaskLists.filter((task) =>
@ -248,7 +246,7 @@ const DailyTask = () => {
task.workItem.completedWork}
</td>
<td>{task.completedTask}</td>
<td>{moment(task.assignmentDate).format("DD-MM-YYYY")}</td>
<td>{formatDate(task.assignmentDate)}</td>
<td className="text-center">
<div
key={refIndex}
@ -266,23 +264,23 @@ const DailyTask = () => {
${task.teamMembers
.map(
(member) => `
<div class="d-flex align-items-center gap-2 mb-2">
<div class="avatar avatar-xs">
<span class="avatar-initial rounded-circle bg-label-primary">
${
member?.firstName?.charAt(
0
) || ""
}${
<div class="d-flex align-items-center gap-2 mb-2">
<div class="avatar avatar-xs">
<span class="avatar-initial rounded-circle bg-label-primary">
${
member?.firstName?.charAt(
0
) || ""
}${
member?.lastName?.charAt(0) || ""
}
</span>
</div>
<span>${member.firstName} ${
</span>
</div>
<span>${member.firstName} ${
member.lastName
}</span>
</div>
`
</div>
`
)
.join("")}
</div>
@ -364,4 +362,4 @@ const DailyTask = () => {
</>
);
};
export default DailyTask;
export default DailyTask;

View File

@ -21,9 +21,8 @@ import ManageBucket from "../../components/Directory/ManageBucket";
import {useFab} from "../../Context/FabContext";
import {DireProvider, useDir} from "../../Context/DireContext";
const Directory = ({IsPage=true,prefernceContacts}) =>
const Directory = () =>
{
const[projectPrefernce,setPerfence] = useState(null)
const[IsActive,setIsActive] = useState(true)
const [isOpenModal, setIsOpenModal] = useState(false);
const [isOpenModalNote, setIsOpenModalNote] = useState(false);
@ -45,7 +44,7 @@ const Directory = ({IsPage=true,prefernceContacts}) =>
const { dirActions, setDirActions } = useDir();
const { contacts, loading , refetch} = useDirectory(IsActive,projectPrefernce);
const { contacts, loading , refetch} = useDirectory(IsActive);
const { contactCategory, loading: contactCategoryLoading } =
useContactCategory();
const {buckets} = useBuckets();
@ -73,7 +72,7 @@ const Directory = ({IsPage=true,prefernceContacts}) =>
// cacheData("Contacts", {data:updatedContacts,isActive:IsActive});
// setContactList(updatedContacts);
refetch(IsActive,prefernceContacts)
refetch()
} catch (error) {
const msg =
error.response?.data?.message ||
@ -217,43 +216,35 @@ const handleDeleteContact = async (overrideId = null) => {
};
useEffect(() => {
const actions = [];
useEffect(() => {
setActions([
{
label: "New Contact",
icon: "bx bx-plus-circle",
color: "warning",
onClick: () => setIsOpenModal(true),
},
{
label: "Manage Bucket",
icon: "fa-solid fa-bucket fs-5 ",
color: "primary",
onClick: () => setOpenBucketModal(true),
},
]);
if (IsPage) {
actions.push({
label: "Manage Bucket",
icon: "fa-solid fa-bucket fs-5",
color:"primary",
onClick: () => setOpenBucketModal(true),
});
}
actions.push({
label: "New Contact",
icon: "bx bx-plus-circle",
color: "warning",
onClick: () => setIsOpenModal(true),
} );
setActions(actions);
return () => setActions([]);
}, [IsPage]);
useEffect( () =>
{
setPerfence(prefernceContacts)
},[prefernceContacts])
return () => setActions([]); // Clean up
}, []);
return (
<div className="container-xxl flex-grow-1 container-p-y">
{IsPage && ( <Breadcrumb
<Breadcrumb
data={[
{ label: "Home", link: "/dashboard" },
{ label: "Directory", link: null },
]}
></Breadcrumb>)}
></Breadcrumb>
{isOpenModal && (
<GlobalModel

View File

@ -29,7 +29,7 @@ const DirectoryPageHeader = ({
<>
<div className="row"></div>
<div className="row mx-0 px-0 align-items-center">
<div className="col-12 col-md-6 mb-2 px-1 d-flex align-items-center gap-4 ">
<div className="col-12 col-md-4 mb-2 px-1 d-flex align-items-center ">
<input
type="search"
className="form-control form-control-sm me-2"
@ -167,7 +167,7 @@ const DirectoryPageHeader = ({
</div>
</div>
</div>
<div className="col-12 col-md-6 mb-2 px-1 d-flex justify-content-end gap-2 align-items-center text-end">
<div className="col-12 col-md-8 mb-2 px-1 d-flex justify-content-end gap-2 align-items-center text-end">
<label className="switch switch-primary align-self-start mb-2">
<input
type="checkbox"

View File

@ -22,7 +22,6 @@ import {
import { useDispatch } from "react-redux";
import { setProjectId } from "../../slices/localVariablesSlice";
import { ComingSoonPage } from "../Misc/ComingSoonPage";
import Directory from "../Directory/Directory";
const ProjectDetails = () => {
let { projectId } = useParams();
@ -118,10 +117,12 @@ const ProjectDetails = () => {
);
break;
}
case "directory": {
case "activities": {
return (
<div className="row">
<Directory IsPage={ false} prefernceContacts={projectDetails.id} />
<div className="col-lg-12 col-xl-12">
<ActivityTimeline></ActivityTimeline>
</div>
</div>
);
}

View File

@ -3,17 +3,7 @@ import {api} from "../utils/axiosClient";
export const DirectoryRepository = {
GetOrganizations:()=>api.get('/api/directory/organization'),
GetContacts: (isActive, projectId) => {
const params = new URLSearchParams();
params.append("active", isActive);
if (projectId) {
params.append("projectId", projectId);
}
return api.get(`/api/Directory?${params.toString()}`);
}
,
GetContacts: (isActive) => api.get( `/api/directory?active=${isActive}` ),
CreateContact: ( data ) => api.post( '/api/directory', data ),
UpdateContact: ( id, data ) => api.put( `/api/directory/${ id }`, data ),
DeleteContact: ( id,isActive) => api.delete( `/api/directory/${ id }/?active=${isActive}` ),