@graphcommerce/magento-store 6.2.0-canary.53 → 6.2.0-canary.55
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 +8 -0
- package/package.json +8 -8
- package/utils/redirectOrNotFound.ts +10 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.2.0-canary.55
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1967](https://github.com/graphcommerce-org/graphcommerce/pull/1967) [`888fe88e6`](https://github.com/graphcommerce-org/graphcommerce/commit/888fe88e644d94621d54a268dbaafc7ff5467c93) - Fix bug where product urls ending with a suffix would not be redirected ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
|
|
8
|
+
|
|
9
|
+
## 6.2.0-canary.54
|
|
10
|
+
|
|
3
11
|
## 6.2.0-canary.53
|
|
4
12
|
|
|
5
13
|
## 6.2.0-canary.52
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-store",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "6.2.0-canary.
|
|
5
|
+
"version": "6.2.0-canary.55",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.
|
|
16
|
-
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.
|
|
17
|
-
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "6.2.0-canary.55",
|
|
16
|
+
"@graphcommerce/prettier-config-pwa": "6.2.0-canary.55",
|
|
17
|
+
"@graphcommerce/typescript-config-pwa": "6.2.0-canary.55"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@graphcommerce/graphql": "6.2.0-canary.
|
|
21
|
-
"@graphcommerce/graphql-mesh": "6.2.0-canary.
|
|
22
|
-
"@graphcommerce/image": "6.2.0-canary.
|
|
23
|
-
"@graphcommerce/next-ui": "6.2.0-canary.
|
|
20
|
+
"@graphcommerce/graphql": "6.2.0-canary.55",
|
|
21
|
+
"@graphcommerce/graphql-mesh": "6.2.0-canary.55",
|
|
22
|
+
"@graphcommerce/image": "6.2.0-canary.55",
|
|
23
|
+
"@graphcommerce/next-ui": "6.2.0-canary.55"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@lingui/react": "^4.2.1",
|
|
@@ -9,7 +9,7 @@ import { nonNullable, isTypename } from '@graphcommerce/next-ui'
|
|
|
9
9
|
import { Redirect } from 'next'
|
|
10
10
|
import { StoreConfigQuery } from '../StoreConfig.gql'
|
|
11
11
|
import { defaultLocale } from '../localeToStore'
|
|
12
|
-
import { HandleRedirectDocument } from './HandleRedirect.gql'
|
|
12
|
+
import { HandleRedirectDocument, HandleRedirectQuery } from './HandleRedirect.gql'
|
|
13
13
|
|
|
14
14
|
export type RedirectOr404Return = Promise<
|
|
15
15
|
| { redirect: Redirect; revalidate?: number | boolean }
|
|
@@ -77,8 +77,16 @@ export async function redirectOrNotFound(
|
|
|
77
77
|
).data,
|
|
78
78
|
)
|
|
79
79
|
|
|
80
|
-
const
|
|
80
|
+
const routeDataArray = (await Promise.all(routePromises)).filter(nonNullable)
|
|
81
81
|
|
|
82
|
+
const routeData: HandleRedirectQuery = Object.assign(
|
|
83
|
+
{},
|
|
84
|
+
...routeDataArray.map((result) => {
|
|
85
|
+
if (!result.route) delete result.route
|
|
86
|
+
if (!result.products) delete result.products
|
|
87
|
+
return result
|
|
88
|
+
}),
|
|
89
|
+
)
|
|
82
90
|
if (!routeData?.route)
|
|
83
91
|
return notFound(
|
|
84
92
|
from,
|