diff --git a/src/components/Dashboard/ServiceJobs.jsx b/src/components/Dashboard/ServiceJobs.jsx index c9c54285..94261790 100644 --- a/src/components/Dashboard/ServiceJobs.jsx +++ b/src/components/Dashboard/ServiceJobs.jsx @@ -3,13 +3,14 @@ import { useParams } from "react-router-dom"; import { useJobsProgression } from "../../hooks/useDashboard_Data"; import { SpinnerLoader } from "../common/Loader"; import { formatUTCToLocalTime } from "../../utils/dateUtils"; +import { useServiceProject } from "../../hooks/useServiceProject"; const ServiceJobs = () => { const { projectId } = useParams(); const { data, isLoading, isError } = useJobsProgression(projectId); const jobs = data || {}; - + const { data: projectData, isLoading: projectLoading } = useServiceProject(projectId); const tabMapping = [ { id: "tab-new", label: "My Jobs", key: "allJobs" }, { id: "tab-preparing", label: "Assigned", key: "assignedJobs" }, @@ -22,7 +23,9 @@ const ServiceJobs = () => {
Service Jobs
-

All Projects

+

+ {projectLoading ? "Loading..." : projectData?.name || "All Projects"} +

diff --git a/src/hooks/useDashboard_Data.jsx b/src/hooks/useDashboard_Data.jsx index af024331..68b914d7 100644 --- a/src/hooks/useDashboard_Data.jsx +++ b/src/hooks/useDashboard_Data.jsx @@ -180,7 +180,7 @@ export const useExpenseStatus = (projectId) => { }; export const useJobsProgression = (projectId) => { return useQuery({ - queryKey: ["jobs_Progression", projectId], + queryKey: ["serviceProjectJobs", projectId], queryFn: async () => { const resp = await GlobalRepository.getJobsProgression(projectId); return resp.data;