feat: product select
This commit is contained in:
@@ -9,12 +9,12 @@ type Props = {
|
||||
}
|
||||
const useProductsList = (props: Props) => {
|
||||
const {clientId, page, itemsPerPage, searchInput} = props;
|
||||
const {data, refetch} = useQuery({
|
||||
const {data, refetch, isLoading} = useQuery({
|
||||
queryKey: ['getAllServices', clientId, page, itemsPerPage, searchInput],
|
||||
queryFn: () => ProductService.getProductsByClientId(props)
|
||||
});
|
||||
const products = !data ? [] : data.products;
|
||||
const paginationInfo = data?.paginationInfo;
|
||||
return {products, paginationInfo, refetch}
|
||||
return {products, paginationInfo, refetch, isLoading}
|
||||
}
|
||||
export default useProductsList;
|
||||
Reference in New Issue
Block a user