| | |
| | | |
| | | type UseEnterpriseInsuranceProductSelectOptions = { |
| | | supplierEnterpriseId: MaybeRef<string>; |
| | | isConfiguredInsurance: MaybeRef<boolean>; |
| | | }; |
| | | |
| | | export function useEnterpriseInsuranceProductSelect( |
| | | options: UseEnterpriseInsuranceProductSelectOptions |
| | | ) { |
| | | const { supplierEnterpriseId } = options; |
| | | const { supplierEnterpriseId, isConfiguredInsurance } = options; |
| | | const queryClient = useQueryClient(); |
| | | |
| | | const { data: enterpriseInsuranceProductSelect } = useQuery({ |
| | |
| | | }, |
| | | placeholderData: () => |
| | | [] as API.SelectOptionNullableGuidGetEnterpriseInsuranceProductSelectQueryOption[], |
| | | enabled: computed(() => !!unref(supplierEnterpriseId)), |
| | | enabled: computed(() => !!unref(supplierEnterpriseId) && unref(isConfiguredInsurance)), |
| | | }); |
| | | |
| | | return { enterpriseInsuranceProductSelect }; |