refactor(Select, AssignToCompanyModalContent): enhance select placeholder and integrate company query
- Updated the Select component to disable the placeholder option for better user experience. - Refactored AssignToCompanyModalContent to accept a companiesQuery prop, improving data handling. - Adjusted the useCustomerListPresenter hook to include the company query, ensuring it is only enabled when the assign company modal is open. - Enhanced the CustomersTable component to pass the company query to the modal content.
This commit is contained in:
@@ -83,10 +83,12 @@ export const useDeleteCompanyQuery = (successCallback?: () => void) => {
|
||||
},
|
||||
});
|
||||
};
|
||||
export const useCompanyFullList = () => {
|
||||
export const useCompanyFullList = (options?: { enabled?: boolean }) => {
|
||||
const enabled = options?.enabled ?? true;
|
||||
return useQuery({
|
||||
queryKey: ["READ ALL Companies"],
|
||||
queryFn: companiesService.getCompanies,
|
||||
enabled,
|
||||
});
|
||||
};
|
||||
export const useCompaniesInfiniteQuery = (params?: Record<string, any>) => {
|
||||
|
||||
Reference in New Issue
Block a user