added provideAll is flag inside basic projctname api
This commit is contained in:
parent
962286a4da
commit
ca88928850
@ -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,
|
||||||
|
@ -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) => {
|
||||||
|
@ -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}`),
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user