@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.
- package/dist/backend-types.d.ts +1 -1
- package/dist/fetchers/carts.d.ts +3673 -758
- package/dist/fetchers/orders.d.ts +1095 -224
- package/dist/fetchers/products.d.ts +622 -40
- package/dist/fetchers/products.js +18 -0
- package/dist/hooks/admin/abandoned-carts.d.ts +708 -124
- package/dist/hooks/admin/customers.d.ts +292 -0
- package/dist/hooks/admin/index.d.ts +8 -7
- package/dist/hooks/admin/index.js +8 -7
- package/dist/hooks/admin/media.d.ts +44 -0
- package/dist/hooks/admin/media.js +86 -0
- package/dist/hooks/admin/orders.d.ts +2533 -781
- package/dist/hooks/admin/products.d.ts +610 -34
- package/dist/hooks/admin/products.js +33 -0
- package/dist/hooks/admin/stats.d.ts +292 -0
- package/dist/hooks/admin/variants.d.ts +5 -0
- package/dist/hooks/admin/warehouses.d.ts +292 -0
- package/dist/hooks/public/carts.d.ts +3763 -848
- package/dist/hooks/public/orders.d.ts +1114 -243
- package/dist/hooks/public/products.d.ts +628 -47
- package/dist/hooks/public/products.js +14 -1
- package/dist/rpc-client.d.ts +15652 -6286
- package/dist/rpc-client.js +3 -0
- package/dist/utils/query-keys.d.ts +6 -0
- package/dist/utils/query-keys.js +6 -0
- package/package.json +3 -3
|
@@ -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
|
+
}
|