@instockng/api-client 1.0.21 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { useQueryUnwrapped } from '../use-query-unwrapped';
8
8
  import { queryKeys } from '../../utils/query-keys';
9
- import { fetchProductsByBrand, fetchProductBySlug } from '../../fetchers/products';
9
+ import { fetchProductsByBrand, fetchProductBySlug, fetchProductAddons } from '../../fetchers/products';
10
10
  /**
11
11
  * Hook to get products by brand using RPC
12
12
  *
@@ -45,3 +45,16 @@ export function useGetProduct(slug, options) {
45
45
  ...options,
46
46
  });
47
47
  }
48
+ /**
49
+ * Hook to get product add-ons
50
+ *
51
+ * @param slug - Product slug
52
+ * @param limit - Max number of add-ons
53
+ */
54
+ export function useGetProductAddOns(slug, limit, options) {
55
+ return useQueryUnwrapped({
56
+ queryKey: queryKeys.public.products.addons(slug, limit),
57
+ queryFn: () => fetchProductAddons(slug, limit),
58
+ ...options,
59
+ });
60
+ }