@voyant-travel/commerce-react 0.21.0 → 0.21.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pricing-categories.d.ts","sourceRoot":"","sources":["../../../src/pricing/hooks/use-pricing-categories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-pricing-categories.d.ts","sourceRoot":"","sources":["../../../src/pricing/hooks/use-pricing-categories.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAA;AAGpE,MAAM,WAAW,2BAA4B,SAAQ,4BAA4B;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,2BAAgC;;;;;;;;;;;;;;;;;;;;;;;;WAQ7E"}
|
|
@@ -1,35 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
|
-
import { fetchWithValidation } from "../client.js";
|
|
4
3
|
import { useVoyantPricingContext } from "../provider.js";
|
|
5
|
-
import {
|
|
6
|
-
import { pricingCategoryListResponse } from "../schemas.js";
|
|
4
|
+
import { getPricingCategoriesQueryOptions } from "../query-options.js";
|
|
7
5
|
export function usePricingCategories(options = {}) {
|
|
8
6
|
const { baseUrl, fetcher } = useVoyantPricingContext();
|
|
9
7
|
const { enabled = true, ...filters } = options;
|
|
10
8
|
return useQuery({
|
|
11
|
-
|
|
12
|
-
queryFn: () => {
|
|
13
|
-
const params = new URLSearchParams();
|
|
14
|
-
if (filters.productId)
|
|
15
|
-
params.set("productId", filters.productId);
|
|
16
|
-
if (filters.optionId)
|
|
17
|
-
params.set("optionId", filters.optionId);
|
|
18
|
-
if (filters.unitId)
|
|
19
|
-
params.set("unitId", filters.unitId);
|
|
20
|
-
if (filters.categoryType)
|
|
21
|
-
params.set("categoryType", filters.categoryType);
|
|
22
|
-
if (filters.active !== undefined)
|
|
23
|
-
params.set("active", String(filters.active));
|
|
24
|
-
if (filters.search)
|
|
25
|
-
params.set("search", filters.search);
|
|
26
|
-
if (filters.limit !== undefined)
|
|
27
|
-
params.set("limit", String(filters.limit));
|
|
28
|
-
if (filters.offset !== undefined)
|
|
29
|
-
params.set("offset", String(filters.offset));
|
|
30
|
-
const qs = params.toString();
|
|
31
|
-
return fetchWithValidation(`/v1/admin/pricing/pricing-categories${qs ? `?${qs}` : ""}`, pricingCategoryListResponse, { baseUrl, fetcher });
|
|
32
|
-
},
|
|
9
|
+
...getPricingCategoriesQueryOptions({ baseUrl, fetcher }, filters),
|
|
33
10
|
enabled,
|
|
34
11
|
});
|
|
35
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pricing-categories.js","sourceRoot":"","sources":["../../../src/pricing/hooks/use-pricing-categories.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"use-pricing-categories.js","sourceRoot":"","sources":["../../../src/pricing/hooks/use-pricing-categories.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAExD,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAA;AAMtE,MAAM,UAAU,oBAAoB,CAAC,UAAuC,EAAE;IAC5E,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,uBAAuB,EAAE,CAAA;IACtD,MAAM,EAAE,OAAO,GAAG,IAAI,EAAE,GAAG,OAAO,EAAE,GAAG,OAAO,CAAA;IAE9C,OAAO,QAAQ,CAAC;QACd,GAAG,gCAAgC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC;QAClE,OAAO;KACR,CAAC,CAAA;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/commerce-react",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -237,9 +237,9 @@
|
|
|
237
237
|
"zod": "^4.0.0",
|
|
238
238
|
"@voyant-travel/admin": "^0.115.4",
|
|
239
239
|
"@voyant-travel/commerce": "^0.21.0",
|
|
240
|
+
"@voyant-travel/ui": "^0.108.10",
|
|
240
241
|
"@voyant-travel/distribution-react": "^0.129.0",
|
|
241
|
-
"@voyant-travel/inventory-react": "^0.21.0"
|
|
242
|
-
"@voyant-travel/ui": "^0.108.10"
|
|
242
|
+
"@voyant-travel/inventory-react": "^0.21.0"
|
|
243
243
|
},
|
|
244
244
|
"peerDependenciesMeta": {
|
|
245
245
|
"@voyant-travel/admin": {
|
|
@@ -276,14 +276,14 @@
|
|
|
276
276
|
"vitest": "^4.1.9",
|
|
277
277
|
"zod": "^4.4.3",
|
|
278
278
|
"@voyant-travel/admin": "^0.115.4",
|
|
279
|
-
"@voyant-travel/commerce": "^0.21.0",
|
|
280
279
|
"@voyant-travel/distribution-react": "^0.129.0",
|
|
281
|
-
"@voyant-travel/
|
|
280
|
+
"@voyant-travel/commerce": "^0.21.0",
|
|
282
281
|
"@voyant-travel/inventory-react": "^0.21.0",
|
|
283
|
-
"@voyant-travel/
|
|
282
|
+
"@voyant-travel/i18n": "^0.109.8",
|
|
284
283
|
"@voyant-travel/ui": "^0.108.10",
|
|
285
|
-
"@voyant-travel/
|
|
286
|
-
"@voyant-travel/voyant-typescript-config": "^0.1.0"
|
|
284
|
+
"@voyant-travel/react": "^0.104.1",
|
|
285
|
+
"@voyant-travel/voyant-typescript-config": "^0.1.0",
|
|
286
|
+
"@voyant-travel/utils": "^0.105.6"
|
|
287
287
|
},
|
|
288
288
|
"files": [
|
|
289
289
|
"dist",
|