added provideAll is flag inside basic projctname api

This commit is contained in:
pramod.mahajan 2025-10-15 12:45:11 +05:30
parent 962286a4da
commit ca88928850
3 changed files with 5 additions and 5 deletions

View File

@ -19,7 +19,7 @@ import { formatDate } from "../../utils/dateUtils";
const ManageCollection = ({ collectionId, onClose }) => { const ManageCollection = ({ collectionId, onClose }) => {
const { data, isError, isLoading, error } = useCollection(collectionId); const { data, isError, isLoading, error } = useCollection(collectionId);
const { projectNames, projectLoading } = useProjectName(); const { projectNames, projectLoading } = useProjectName(true);
const methods = useForm({ const methods = useForm({
resolver: zodResolver(newCollection), resolver: zodResolver(newCollection),
defaultValues: defaultCollection, defaultValues: defaultCollection,

View File

@ -153,7 +153,7 @@ export const useProjectsAllocationByEmployee = (employeeId) => {
return { projectList, loading: isLoading, error, refetch }; return { projectList, loading: isLoading, error, refetch };
}; };
export const useProjectName = () => { export const useProjectName = (provideAll=false) => {
const { const {
data = [], data = [],
isLoading, isLoading,
@ -161,9 +161,9 @@ export const useProjectName = () => {
refetch, refetch,
isError, isError,
} = useQuery({ } = useQuery({
queryKey: ["basicProjectNameList"], queryKey: ["basicProjectNameList",provideAll],
queryFn: async () => { queryFn: async () => {
const res = await ProjectRepository.projectNameList(); const res = await ProjectRepository.projectNameList(provideAll);
return res.data || res; return res.data || res;
}, },
onError: (error) => { onError: (error) => {

View File

@ -40,7 +40,7 @@ const ProjectRepository = {
api.get(`/api/project/allocation-histery/${id}`), api.get(`/api/project/allocation-histery/${id}`),
updateProjectsByEmployee: (id, data) => updateProjectsByEmployee: (id, data) =>
api.post(`/api/project/assign-projects/${id}`, data), api.post(`/api/project/assign-projects/${id}`, data),
projectNameList: () => api.get("/api/project/list/basic"), projectNameList: (provideAll) => api.get(`/api/project/list/basic?provideAll=${provideAll}`),
getProjectDetails: (id) => api.get(`/api/project/details/${id}`), getProjectDetails: (id) => api.get(`/api/project/details/${id}`),