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
@@ -2,6 +2,7 @@
import {
useAssignCompany,
useCompanyFullList,
useCustomersQuery,
useDeleteCustomerQuery,
} from "@/hooks/queries";
@@ -41,6 +42,9 @@ const useCustomerListPresenter = () => {
} = useForm();
const { data, isPending } = useCustomersQuery(params);
const assignCompanyCompaniesQuery = useCompanyFullList({
enabled: isAssignCompanyModalOpen,
});
const { mutate: deleteCustomer } = useDeleteCustomerQuery(() =>
setIsModalOpen(false),
);
@@ -104,6 +108,7 @@ const useCustomerListPresenter = () => {
setFilterValue,
isMutating,
setParams,
assignCompanyCompaniesQuery,
};
};