@@ -168,10 +159,7 @@ const SelectMultiple = ({
const found = options.find((opt) => opt[valueKey] === val);
const label = found ? getLabel(found) : "";
return (
-
+
{label}
);
diff --git a/src/hooks/useOrganization.js b/src/hooks/useOrganization.js
index 2248f7bc..e99d8ccb 100644
--- a/src/hooks/useOrganization.js
+++ b/src/hooks/useOrganization.js
@@ -40,7 +40,10 @@ export const useOrganizationModal = () => {
export const useOrganization=(id)=>{
return useQuery({
queryKey:["organization",id],
- queryFn:async()=> await OrganizationRepository.getOrganizaion(id),
+ queryFn:async()=> {
+ const resp = await await OrganizationRepository.getOrganizaion(id);
+ return resp.data
+ },
enabled:!!id
})
}
@@ -171,7 +174,7 @@ export const useAssignOrgToTenant = (onSuccessCallback) => {
},
});
};
-export const useUpdateOrganization = () => {
+export const useUpdateOrganization = (onSuccessCallback) => {
const useClient = useQueryClient();
return useMutation({
mutationFn: async ({orgId,payload}) =>
diff --git a/src/pages/DailyProgressReport/DailyProgrssReport.jsx b/src/pages/DailyProgressReport/DailyProgrssReport.jsx
index cce50688..96d9de6c 100644
--- a/src/pages/DailyProgressReport/DailyProgrssReport.jsx
+++ b/src/pages/DailyProgressReport/DailyProgrssReport.jsx
@@ -21,7 +21,7 @@ export const useDailyProgrssContext = () => {
const DailyProgrssReport = () => {
const [service, setService] = useState("");
-
+ const [filter,setFilter] = useState('')
const { setOffcanvasContent, setShowTrigger } = useFab();
const { data, isLoading, isError, error } = useServices();
@@ -30,15 +30,20 @@ const DailyProgrssReport = () => {
const openModal = (type, data = null) => setModal({ type, data });
const closeModal = () => setModal({ type: null, data: null });
- const contextObj = {
+ const contextDispatcher = {
service,
openModal,
closeModal,
+ filter,
};
+ const handleFilter = (filterObj)=>{
+ setFilter(filterObj)
+ }
+
useEffect(() => {
setShowTrigger(true);
- setOffcanvasContent("Report Filter", );
+ setOffcanvasContent("Report Filter", );
return () => {
setShowTrigger(false);
@@ -47,7 +52,7 @@ const DailyProgrssReport = () => {
}, []);
return (
-
+
{modal.type === "report" && (
diff --git a/src/repositories/OrganizationRespository.jsx b/src/repositories/OrganizationRespository.jsx
index 818cdb59..722423a9 100644
--- a/src/repositories/OrganizationRespository.jsx
+++ b/src/repositories/OrganizationRespository.jsx
@@ -2,7 +2,7 @@ import { api } from "../utils/axiosClient";
const OrganizationRepository = {
createOrganization: (data) => api.post("/api/Organization/create", data),
- updateOrganizaion:(id,data)=>api.put(`/api/Organization/edit/${id}`),
+ updateOrganizaion:(id,data)=>api.put(`/api/Organization/edit/${id}`,data),
getOrganizaion:(id)=>api.get(`/api/Organization/details/${id}`),
getOrganizationList: (pageSize, pageNumber, active, sprid, searchString) => {
return api.get(
diff --git a/src/repositories/TaskRepository.jsx b/src/repositories/TaskRepository.jsx
index 9afc47a0..33883452 100644
--- a/src/repositories/TaskRepository.jsx
+++ b/src/repositories/TaskRepository.jsx
@@ -12,6 +12,7 @@ export const TasksRepository = {
const payloadJsonString = encodeURIComponent(JSON.stringify(filter));
url += `&filter=${payloadJsonString}`;
}
+ debugger
return api.get(url);
},
diff --git a/src/utils/appUtils.js b/src/utils/appUtils.js
index 21f7fa5a..6f652db9 100644
--- a/src/utils/appUtils.js
+++ b/src/utils/appUtils.js
@@ -1,31 +1,31 @@
import { useEffect, useState } from "react";
import { format, parseISO } from "date-fns";
-export const formatFileSize=(bytes)=> {
+export const formatFileSize = (bytes) => {
if (bytes < 1024) return bytes + " B";
else if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(2) + " KB";
else return (bytes / (1024 * 1024)).toFixed(2) + " MB";
-}
+};
export const AppColorconfig = {
colors: {
- primary: '#696cff',
- secondary: '#8592a3',
- success: '#71dd37',
- info: '#03c3ec',
- warning: '#ffab00',
- danger: '#ff3e1d',
- dark: '#233446',
- black: '#000',
- white: '#fff',
- cardColor: '#fff',
- bodyBg: '#f5f5f9',
- bodyColor: '#697a8d',
- headingColor: '#566a7f',
- textMuted: '#a1acb8',
- borderColor: '#eceef1'
- }
+ primary: "#696cff",
+ secondary: "#8592a3",
+ success: "#71dd37",
+ info: "#03c3ec",
+ warning: "#ffab00",
+ danger: "#ff3e1d",
+ dark: "#233446",
+ black: "#000",
+ white: "#fff",
+ cardColor: "#fff",
+ bodyBg: "#f5f5f9",
+ bodyColor: "#697a8d",
+ headingColor: "#566a7f",
+ textMuted: "#a1acb8",
+ borderColor: "#eceef1",
+ },
};
export const getColorNameFromHex = (hex) => {
- const normalizedHex = hex?.replace(/'/g, '').toLowerCase();
+ const normalizedHex = hex?.replace(/'/g, "").toLowerCase();
const colors = AppColorconfig.colors;
for (const [name, value] of Object.entries(colors)) {
@@ -62,18 +62,19 @@ export const getIconByFileType = (type = "") => {
return "bx bx-file";
};
-
export const normalizeAllowedContentTypes = (allowedContentType) => {
if (!allowedContentType) return [];
if (Array.isArray(allowedContentType)) return allowedContentType;
- if (typeof allowedContentType === "string") return allowedContentType.split(",");
+ if (typeof allowedContentType === "string")
+ return allowedContentType.split(",");
return [];
};
-
export function localToUtc(localDateString) {
- if (!localDateString || localDateString.trim() === "") return null; // return null instead of undefined
- const date = new Date(localDateString);
- if (isNaN(date.getTime())) return null; // invalid date check
- return date.toISOString();
-}
\ No newline at end of file
+ if (!localDateString || localDateString.trim() === "") return null;
+
+ const [day, month, year] = localDateString.split("-");
+ const date = new Date(`${year}-${month}-${day}T00:00:00`);
+
+ return isNaN(date.getTime()) ? null : date.toISOString();
+}
diff --git a/src/utils/axiosClient.jsx b/src/utils/axiosClient.jsx
index 1cc0c7cd..bf26500e 100644
--- a/src/utils/axiosClient.jsx
+++ b/src/utils/axiosClient.jsx
@@ -16,7 +16,6 @@ export const axiosClient = axios.create({
// Auto retry failed requests (e.g., network issues)
axiosRetry(axiosClient, { retries: 3 });
-debugger
// Request Interceptor — Add Bearer token if required
axiosClient.interceptors.request.use(
async (config) => {