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 { data, isError, isLoading, error } = useCollection(collectionId);
|
||||
const { projectNames, projectLoading } = useProjectName();
|
||||
const { projectNames, projectLoading } = useProjectName(true);
|
||||
const methods = useForm({
|
||||
resolver: zodResolver(newCollection),
|
||||
defaultValues: defaultCollection,
|
||||
|
@ -153,7 +153,7 @@ export const useProjectsAllocationByEmployee = (employeeId) => {
|
||||
return { projectList, loading: isLoading, error, refetch };
|
||||
};
|
||||
|
||||
export const useProjectName = () => {
|
||||
export const useProjectName = (provideAll=false) => {
|
||||
const {
|
||||
data = [],
|
||||
isLoading,
|
||||
@ -161,9 +161,9 @@ export const useProjectName = () => {
|
||||
refetch,
|
||||
isError,
|
||||
} = useQuery({
|
||||
queryKey: ["basicProjectNameList"],
|
||||
queryKey: ["basicProjectNameList",provideAll],
|
||||
queryFn: async () => {
|
||||
const res = await ProjectRepository.projectNameList();
|
||||
const res = await ProjectRepository.projectNameList(provideAll);
|
||||
return res.data || res;
|
||||
},
|
||||
onError: (error) => {
|
||||
|
@ -40,7 +40,7 @@ const ProjectRepository = {
|
||||
api.get(`/api/project/allocation-histery/${id}`),
|
||||
updateProjectsByEmployee: (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}`),
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user