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:
AmirReza Jamali
2026-04-13 19:27:22 +03:30
parent 8e86b8f894
commit c93a1ffe8d
5 changed files with 30 additions and 6 deletions
+3 -1
View File
@@ -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>) => {