@graphcommerce/magento-product 9.0.0-canary.62 → 9.0.0-canary.64
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/CHANGELOG.md
CHANGED
@@ -15,7 +15,7 @@ export function parseParams(
|
|
15
15
|
filterTypes: FilterTypes,
|
16
16
|
search: string | null = null,
|
17
17
|
): ProductListParams | undefined {
|
18
|
-
const
|
18
|
+
const productListParams: ProductListParams = { url, filters: {}, sort: {}, search }
|
19
19
|
|
20
20
|
const typeMap = filterTypes
|
21
21
|
|
@@ -25,20 +25,24 @@ export function parseParams(
|
|
25
25
|
if (!param || param === 'q') return value
|
26
26
|
|
27
27
|
if (param === 'page') {
|
28
|
-
|
28
|
+
productListParams.currentPage = Number(value)
|
29
29
|
return undefined
|
30
30
|
}
|
31
31
|
if (param === 'page-size') {
|
32
|
-
|
32
|
+
productListParams.pageSize = Number(value)
|
33
33
|
return undefined
|
34
34
|
}
|
35
35
|
if (param === 'sort') {
|
36
|
-
|
36
|
+
productListParams.sort[value] = 'ASC'
|
37
37
|
return undefined
|
38
38
|
}
|
39
39
|
if (param === 'dir') {
|
40
|
-
const [sortBy] = Object.keys(
|
41
|
-
if (sortBy)
|
40
|
+
const [sortBy] = Object.keys(productListParams.sort)
|
41
|
+
if (sortBy) productListParams.sort[sortBy] = value?.toUpperCase() as SortEnum
|
42
|
+
return undefined
|
43
|
+
}
|
44
|
+
if (param === 'category_uid') {
|
45
|
+
productListParams.filters.category_uid = { eq: value }
|
42
46
|
return undefined
|
43
47
|
}
|
44
48
|
|
@@ -47,10 +51,10 @@ export function parseParams(
|
|
47
51
|
case 'BOOLEAN':
|
48
52
|
case 'SELECT':
|
49
53
|
case 'MULTISELECT':
|
50
|
-
|
54
|
+
productListParams.filters[param] = { in: value.split(',') } as FilterEqualTypeInput
|
51
55
|
return undefined
|
52
56
|
case 'PRICE':
|
53
|
-
|
57
|
+
productListParams.filters[param] = {
|
54
58
|
...(from !== '*' && { from }),
|
55
59
|
...(to !== '*' && { to }),
|
56
60
|
} as FilterRangeTypeInput
|
@@ -62,7 +66,7 @@ export function parseParams(
|
|
62
66
|
return undefined
|
63
67
|
}, undefined)
|
64
68
|
|
65
|
-
return error ? undefined :
|
69
|
+
return error ? undefined : productListParams
|
66
70
|
}
|
67
71
|
|
68
72
|
export function extractUrlQuery(params?: { url: string[] }) {
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@graphcommerce/magento-product",
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
5
|
-
"version": "9.0.0-canary.
|
5
|
+
"version": "9.0.0-canary.64",
|
6
6
|
"sideEffects": false,
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
8
8
|
"eslintConfig": {
|
@@ -18,19 +18,19 @@
|
|
18
18
|
"typescript": "5.5.3"
|
19
19
|
},
|
20
20
|
"peerDependencies": {
|
21
|
-
"@graphcommerce/ecommerce-ui": "^9.0.0-canary.
|
22
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.
|
23
|
-
"@graphcommerce/framer-next-pages": "^9.0.0-canary.
|
24
|
-
"@graphcommerce/framer-scroller": "^9.0.0-canary.
|
25
|
-
"@graphcommerce/graphql": "^9.0.0-canary.
|
26
|
-
"@graphcommerce/graphql-mesh": "^9.0.0-canary.
|
27
|
-
"@graphcommerce/image": "^9.0.0-canary.
|
28
|
-
"@graphcommerce/magento-cart": "^9.0.0-canary.
|
29
|
-
"@graphcommerce/magento-category": "^9.0.0-canary.
|
30
|
-
"@graphcommerce/magento-store": "^9.0.0-canary.
|
31
|
-
"@graphcommerce/next-ui": "^9.0.0-canary.
|
32
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.
|
33
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.
|
21
|
+
"@graphcommerce/ecommerce-ui": "^9.0.0-canary.64",
|
22
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.64",
|
23
|
+
"@graphcommerce/framer-next-pages": "^9.0.0-canary.64",
|
24
|
+
"@graphcommerce/framer-scroller": "^9.0.0-canary.64",
|
25
|
+
"@graphcommerce/graphql": "^9.0.0-canary.64",
|
26
|
+
"@graphcommerce/graphql-mesh": "^9.0.0-canary.64",
|
27
|
+
"@graphcommerce/image": "^9.0.0-canary.64",
|
28
|
+
"@graphcommerce/magento-cart": "^9.0.0-canary.64",
|
29
|
+
"@graphcommerce/magento-category": "^9.0.0-canary.64",
|
30
|
+
"@graphcommerce/magento-store": "^9.0.0-canary.64",
|
31
|
+
"@graphcommerce/next-ui": "^9.0.0-canary.64",
|
32
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.64",
|
33
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.64",
|
34
34
|
"@lingui/core": "^4.2.1",
|
35
35
|
"@lingui/macro": "^4.2.1",
|
36
36
|
"@lingui/react": "^4.2.1",
|