@akinon/next 1.55.0-rc.0 → 1.55.0
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 +6 -483
- package/api/client.ts +17 -50
- package/assets/styles/index.scss +26 -50
- package/bin/pz-prebuild.js +0 -1
- package/bin/pz-predev.js +0 -1
- package/components/index.ts +0 -1
- package/components/input.tsx +7 -21
- package/components/link.tsx +13 -17
- package/components/price.tsx +4 -11
- package/components/pz-root.tsx +3 -15
- package/components/selected-payment-option-view.tsx +38 -26
- package/data/client/account.ts +9 -10
- package/data/client/api.ts +1 -1
- package/data/client/b2b.ts +2 -35
- package/data/client/basket.ts +5 -6
- package/data/client/checkout.ts +1 -38
- package/data/client/user.ts +2 -3
- package/data/server/category.ts +19 -43
- package/data/server/flatpage.ts +7 -29
- package/data/server/form.ts +11 -29
- package/data/server/landingpage.ts +7 -26
- package/data/server/list.ts +6 -16
- package/data/server/menu.ts +2 -15
- package/data/server/product.ts +13 -33
- package/data/server/seo.ts +24 -17
- package/data/server/special-page.ts +5 -15
- package/data/server/widget.ts +7 -14
- package/data/urls.ts +1 -8
- package/hocs/server/with-segment-defaults.tsx +1 -4
- package/hooks/index.ts +1 -2
- package/hooks/use-pagination.ts +2 -2
- package/hooks/use-payment-options.ts +1 -2
- package/lib/cache.ts +6 -8
- package/middlewares/default.ts +8 -87
- package/middlewares/pretty-url.ts +1 -11
- package/middlewares/url-redirection.ts +0 -4
- package/package.json +3 -4
- package/redux/middlewares/checkout.ts +10 -69
- package/redux/reducers/checkout.ts +3 -23
- package/types/commerce/account.ts +0 -1
- package/types/commerce/address.ts +1 -1
- package/types/commerce/b2b.ts +2 -12
- package/types/commerce/checkout.ts +0 -30
- package/types/commerce/order.ts +0 -1
- package/types/index.ts +2 -18
- package/utils/app-fetch.ts +8 -17
- package/utils/generate-commerce-search-params.ts +1 -3
- package/utils/index.ts +6 -27
- package/utils/server-translation.ts +1 -11
- package/utils/server-variables.ts +1 -2
- package/with-pz-config.js +2 -13
- package/assets/styles/index.css +0 -49
- package/assets/styles/index.css.map +0 -1
- package/bin/pz-generate-translations.js +0 -41
- package/components/file-input.tsx +0 -8
- package/hooks/use-message-listener.ts +0 -24
- package/lib/cache-handler.mjs +0 -33
- package/routes/pretty-url.tsx +0 -192
- package/utils/redirection-iframe.ts +0 -85
package/CHANGELOG.md
CHANGED
|
@@ -1,55 +1,12 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
-
## 1.55.0
|
|
4
|
-
|
|
5
|
-
### Minor Changes
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
- a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
|
|
10
|
-
- fda5b927: ZERO-2725: fix invalid import
|
|
11
|
-
- 2d9b2b2c: ZERO-2816: Add segment to headers
|
|
12
|
-
- c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
|
|
13
|
-
- d93a507: ZERO-2900: Fix pretty url rewrite
|
|
14
|
-
- 6c25f66: ZERO-2551: Check CACHE_HOST variable
|
|
15
|
-
- bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
|
|
16
|
-
- 3bf2dd9: ZERO-2551: Fix search page
|
|
17
|
-
- e9541a13: ZERO-2816: Add headers to url
|
|
18
|
-
- c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
|
|
19
|
-
- 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
|
|
20
|
-
- 64699d3: ZERO-2761: Fix invalid import for plugin module
|
|
21
|
-
- 0d3a913e: ZERO-2725: Update decimal scale in Price component
|
|
22
|
-
- 1448a96e: ZERO-2612: add errors type in CheckoutState
|
|
23
|
-
- d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
|
|
24
|
-
- d3474c64: ZERO-2655: Add data source shipping option
|
|
25
|
-
- 75080fd6: ZERO-2630: Add max limit to postcode area
|
|
26
|
-
- 17f8752: ZERO-2816: Make the incoming currency lowercase
|
|
27
|
-
- c45b62c: ZERO-2818: Add upload and download support for b2b package
|
|
28
|
-
- 91265bba: ZERO-2551: Improve pretty url and caching performance
|
|
29
|
-
- bbe18b9f: ZERO-2575: Fix build error
|
|
30
|
-
- d4099960: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
|
|
31
|
-
- 4920742: Disable getCachedTranslations
|
|
32
|
-
- 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
|
|
33
|
-
- 7e56d6b: ZERO-2841: Update api tagTypes
|
|
34
|
-
- 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
|
|
35
|
-
- 98bb8dcd: ZERO-2706: Cache getTranlations method
|
|
36
|
-
- dcc8a150: ZERO-2694: added build step to RC branch pipeline
|
|
37
|
-
- 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
|
|
38
|
-
- fad27689: ZERO-2739: add gpay to payment plugin map
|
|
39
|
-
- dff0d595: ZERO-2659: add formData support to proxy api requests
|
|
40
|
-
- fdd0b41: ZERO-2706: Add optimized translation support
|
|
3
|
+
## 1.55.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1448a96: ZERO-2612: add errors type in CheckoutState
|
|
8
|
+
- 75080fd: ZERO-2630: Add max limit to postcode area
|
|
41
9
|
- eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
|
|
42
|
-
- f2c325c: ZERO-2838: Move file input component into @akinon/next
|
|
43
|
-
- 9e25a64: ZERO-2835: Update category page layout with breadcrumb
|
|
44
|
-
- beb499e6: ZERO-2551: Add new tsconfig paths
|
|
45
|
-
- f2c92d5: ZERO-2816: Update cookie name
|
|
46
|
-
- 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
|
|
47
|
-
- f046f8e0: ZERO-2575: update version for react-number-format
|
|
48
|
-
- b9273fd: ZERO-2889: add host headers to requests
|
|
49
|
-
- 49eeebf: ZERO-2909: Add deleteCollectionItem query to wishlistApi
|
|
50
|
-
- 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
|
|
51
|
-
- c670bd4: ZERO-2900: Add middleware rewrite functionality
|
|
52
|
-
- 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
|
|
53
10
|
|
|
54
11
|
## 1.54.0
|
|
55
12
|
|
|
@@ -87,128 +44,7 @@
|
|
|
87
44
|
|
|
88
45
|
### Minor Changes
|
|
89
46
|
|
|
90
|
-
- 90282b53: ZERO-2729: Audit packages for yarn and npm and also update app-template
|
|
91
|
-
- 572d2e84: ZERO-2667: Add iframe support for redirection payment methods
|
|
92
|
-
- 5dfeea0: ZERO-2801: Revert ZERO-2801
|
|
93
|
-
- a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
|
|
94
|
-
- fda5b927: ZERO-2725: fix invalid import
|
|
95
|
-
- 2d9b2b2: ZERO-2816: Add segment to headers
|
|
96
|
-
- c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
|
|
97
|
-
- d93a507: ZERO-2900: Fix pretty url rewrite
|
|
98
|
-
- 8d9ac9a: ZERO-2794: Add field to order type
|
|
99
|
-
- 70279e7: ZERO-2817: Add metrics endpoint in default middleware
|
|
100
|
-
- 6c25f66: ZERO-2551: Check CACHE_HOST variable
|
|
101
|
-
- bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
|
|
102
|
-
- 3bf2dd9: ZERO-2551: Fix search page
|
|
103
|
-
- e9541a1: ZERO-2816: Add headers to url
|
|
104
|
-
- c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
|
|
105
|
-
- 9d94f7e: ZERO-2820: update parent pk usage for menu generator
|
|
106
|
-
- 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
|
|
107
|
-
- 64699d3: ZERO-2761: Fix invalid import for plugin module
|
|
108
|
-
- 0d3a913e: ZERO-2725: Update decimal scale in Price component
|
|
109
|
-
- 1448a96e: ZERO-2612: add errors type in CheckoutState
|
|
110
|
-
- 1ec2e9d: ZERO-2895: Update app-fetch to include cookies in headers
|
|
111
|
-
- d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
|
|
112
|
-
- d3474c64: ZERO-2655: Add data source shipping option
|
|
113
|
-
- 75080fd6: ZERO-2630: Add max limit to postcode area
|
|
114
|
-
- 17f8752: ZERO-2816: Make the incoming currency lowercase
|
|
115
|
-
- c45b62c: ZERO-2818: Add upload and download support for b2b package
|
|
116
|
-
- 91265bba: ZERO-2551: Improve pretty url and caching performance
|
|
117
|
-
- bbe18b9f: ZERO-2575: Fix build error
|
|
118
|
-
- d4099960: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
|
|
119
|
-
- 4920742: Disable getCachedTranslations
|
|
120
|
-
- 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
|
|
121
|
-
- 7e56d6b: ZERO-2841: Update api tagTypes
|
|
122
|
-
- 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
|
|
123
|
-
- 98bb8dcd: ZERO-2706: Cache getTranlations method
|
|
124
|
-
- 46b7aad7: ZERO-2775: Add condition and logger for menuitemmodel data
|
|
125
|
-
- dcc8a150: ZERO-2694: added build step to RC branch pipeline
|
|
126
|
-
- 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
|
|
127
|
-
- fad27689: ZERO-2739: add gpay to payment plugin map
|
|
128
|
-
- dff0d595: ZERO-2659: add formData support to proxy api requests
|
|
129
|
-
- fdd0b41: ZERO-2706: Add optimized translation support
|
|
130
|
-
- eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
|
|
131
|
-
- f2c325c: ZERO-2838: Move file input component into @akinon/next
|
|
132
|
-
- 9e25a64: ZERO-2835: Update category page layout with breadcrumb
|
|
133
|
-
- beb499e6: ZERO-2551: Add new tsconfig paths
|
|
134
|
-
- 146ea391: ZERO-2774: Update imports
|
|
135
|
-
- f2c92d5: ZERO-2816: Update cookie name
|
|
136
|
-
- 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
|
|
137
|
-
- c47be30d: ZERO-2744: Update Order and OrderItem types
|
|
138
|
-
- e9a46acb: ZERO-2738: add CVC input to registered cards in Masterpass
|
|
139
|
-
- f046f8e0: ZERO-2575: update version for react-number-format
|
|
140
|
-
- b9273fd: ZERO-2889: add host headers to requests
|
|
141
|
-
- 49eeebf: ZERO-2909: Add deleteCollectionItem query to wishlistApi
|
|
142
|
-
- 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
|
|
143
|
-
- c670bd4: ZERO-2900: Add middleware rewrite functionality
|
|
144
|
-
- 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
|
|
145
|
-
- 3d35f70: ZERO-2908: Add cookie to redirect url
|
|
146
|
-
|
|
147
|
-
## 1.50.0-rc.1
|
|
148
|
-
|
|
149
|
-
### Minor Changes
|
|
150
|
-
|
|
151
|
-
- 49eeebf: ZERO-2909: Add deleteCollectionItem query to wishlistApi
|
|
152
|
-
|
|
153
|
-
## 1.50.0-rc.0
|
|
154
|
-
|
|
155
|
-
### Minor Changes
|
|
156
|
-
|
|
157
|
-
- 90282b53: ZERO-2729: Audit packages for yarn and npm and also update app-template
|
|
158
|
-
- 572d2e84: ZERO-2667: Add iframe support for redirection payment methods
|
|
159
|
-
- 5dfeea0: ZERO-2801: Revert ZERO-2801
|
|
160
|
-
- a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
|
|
161
|
-
- fda5b927: ZERO-2725: fix invalid import
|
|
162
|
-
- 2d9b2b2: ZERO-2816: Add segment to headers
|
|
163
|
-
- c53ea3e6: ZERO-2609: Reset additional form fields when selectedFormType is not company
|
|
164
|
-
- d93a507: ZERO-2900: Fix pretty url rewrite
|
|
165
|
-
- 8d9ac9a: ZERO-2794: Add field to order type
|
|
166
47
|
- eaf97d6: ZERO-2909: Add deleteCollectionItem query to wishlistApi
|
|
167
|
-
- 70279e7: ZERO-2817: Add metrics endpoint in default middleware
|
|
168
|
-
- 6c25f66: ZERO-2551: Check CACHE_HOST variable
|
|
169
|
-
- bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
|
|
170
|
-
- 3bf2dd9: ZERO-2551: Fix search page
|
|
171
|
-
- e9541a1: ZERO-2816: Add headers to url
|
|
172
|
-
- c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
|
|
173
|
-
- 9d94f7e: ZERO-2820: update parent pk usage for menu generator
|
|
174
|
-
- 2e6104d: ZERO-2888:Edit the numbering in the pagination and the visibility of the prev and next buttons
|
|
175
|
-
- 64699d3: ZERO-2761: Fix invalid import for plugin module
|
|
176
|
-
- 0d3a913e: ZERO-2725: Update decimal scale in Price component
|
|
177
|
-
- 1448a96e: ZERO-2612: add errors type in CheckoutState
|
|
178
|
-
- 1ec2e9d: ZERO-2895: Update app-fetch to include cookies in headers
|
|
179
|
-
- d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
|
|
180
|
-
- d3474c64: ZERO-2655: Add data source shipping option
|
|
181
|
-
- 75080fd6: ZERO-2630: Add max limit to postcode area
|
|
182
|
-
- 17f8752: ZERO-2816: Make the incoming currency lowercase
|
|
183
|
-
- c45b62c: ZERO-2818: Add upload and download support for b2b package
|
|
184
|
-
- 91265bba: ZERO-2551: Improve pretty url and caching performance
|
|
185
|
-
- bbe18b9f: ZERO-2575: Fix build error
|
|
186
|
-
- d4099960: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
|
|
187
|
-
- 4920742: Disable getCachedTranslations
|
|
188
|
-
- 12a873e: ZERO-2846:Edit the siteKey regex in the response from GetCaptcha
|
|
189
|
-
- 7e56d6b: ZERO-2841: Update api tagTypes
|
|
190
|
-
- 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
|
|
191
|
-
- 98bb8dcd: ZERO-2706: Cache getTranlations method
|
|
192
|
-
- 46b7aad7: ZERO-2775: Add condition and logger for menuitemmodel data
|
|
193
|
-
- dcc8a150: ZERO-2694: added build step to RC branch pipeline
|
|
194
|
-
- 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
|
|
195
|
-
- fad27689: ZERO-2739: add gpay to payment plugin map
|
|
196
|
-
- dff0d595: ZERO-2659: add formData support to proxy api requests
|
|
197
|
-
- fdd0b41: ZERO-2706: Add optimized translation support
|
|
198
|
-
- eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
|
|
199
|
-
- f2c325c: ZERO-2838: Move file input component into @akinon/next
|
|
200
|
-
- 9e25a64: ZERO-2835: Update category page layout with breadcrumb
|
|
201
|
-
- beb499e6: ZERO-2551: Add new tsconfig paths
|
|
202
|
-
- 146ea391: ZERO-2774: Update imports
|
|
203
|
-
- f2c92d5: ZERO-2816: Update cookie name
|
|
204
|
-
- 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
|
|
205
|
-
- c47be30d: ZERO-2744: Update Order and OrderItem types
|
|
206
|
-
- e9a46acb: ZERO-2738: add CVC input to registered cards in Masterpass
|
|
207
|
-
- f046f8e0: ZERO-2575: update version for react-number-format
|
|
208
|
-
- b9273fd: ZERO-2889: add host headers to requests
|
|
209
|
-
- 86d25315: ZERO-2693: resolve dependency collision warning for eslint-config-next
|
|
210
|
-
- c670bd4: ZERO-2900: Add middleware rewrite functionality
|
|
211
|
-
- 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
|
|
212
48
|
|
|
213
49
|
## 1.49.0
|
|
214
50
|
|
|
@@ -234,126 +70,7 @@
|
|
|
234
70
|
|
|
235
71
|
### Minor Changes
|
|
236
72
|
|
|
237
|
-
- 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
|
|
238
|
-
- 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
|
|
239
|
-
- a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
|
|
240
|
-
- fda5b92: ZERO-2725: fix invalid import
|
|
241
|
-
- 2d9b2b2: ZERO-2816: Add segment to headers
|
|
242
|
-
- c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
|
|
243
|
-
- 8d9ac9a: ZERO-2794: Add field to order type
|
|
244
|
-
- 70279e7: ZERO-2817: Add metrics endpoint in default middleware
|
|
245
|
-
- 6c25f66: ZERO-2551: Check CACHE_HOST variable
|
|
246
|
-
- bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
|
|
247
|
-
- 3bf2dd9: ZERO-2551: Fix search page
|
|
248
|
-
- e9541a1: ZERO-2816: Add headers to url
|
|
249
|
-
- c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
|
|
250
|
-
- 9d94f7e: ZERO-2820: update parent pk usage for menu generator
|
|
251
|
-
- 64699d3: ZERO-2761: Fix invalid import for plugin module
|
|
252
|
-
- 0d3a913: ZERO-2725: Update decimal scale in Price component
|
|
253
|
-
- 1448a96e: ZERO-2612: add errors type in CheckoutState
|
|
254
|
-
- d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
|
|
255
|
-
- d3474c6: ZERO-2655: Add data source shipping option
|
|
256
|
-
- 75080fd6: ZERO-2630: Add max limit to postcode area
|
|
257
|
-
- 17f8752: ZERO-2816: Make the incoming currency lowercase
|
|
258
|
-
- c45b62c: ZERO-2818: Add upload and download support for b2b package
|
|
259
|
-
- 91265bba: ZERO-2551: Improve pretty url and caching performance
|
|
260
|
-
- bbe18b9f: ZERO-2575: Fix build error
|
|
261
|
-
- d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
|
|
262
|
-
- 4920742: Disable getCachedTranslations
|
|
263
|
-
- 7e56d6b: ZERO-2841: Update api tagTypes
|
|
264
|
-
- 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
|
|
265
|
-
- 98bb8dc: ZERO-2706: Cache getTranlations method
|
|
266
|
-
- 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
|
|
267
|
-
- dcc8a15: ZERO-2694: added build step to RC branch pipeline
|
|
268
|
-
- 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
|
|
269
|
-
- fad2768: ZERO-2739: add gpay to payment plugin map
|
|
270
|
-
- dff0d595: ZERO-2659: add formData support to proxy api requests
|
|
271
|
-
- eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
|
|
272
|
-
- f2c325c: ZERO-2838: Move file input component into @akinon/next
|
|
273
|
-
- 9e25a64: ZERO-2835: Update category page layout with breadcrumb
|
|
274
|
-
- beb499e6: ZERO-2551: Add new tsconfig paths
|
|
275
|
-
- 948eb42: ZERO-2852: Add out of stock endpoints
|
|
276
|
-
- 146ea39: ZERO-2774: Update imports
|
|
277
|
-
- f2c92d5: ZERO-2816: Update cookie name
|
|
278
|
-
- 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
|
|
279
|
-
- c47be30: ZERO-2744: Update Order and OrderItem types
|
|
280
|
-
- e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
|
|
281
|
-
- f046f8e0: ZERO-2575: update version for react-number-format
|
|
282
|
-
- 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
|
|
283
|
-
- 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
|
|
284
|
-
|
|
285
|
-
## 1.45.0-rc.4
|
|
286
|
-
|
|
287
|
-
### Minor Changes
|
|
288
|
-
|
|
289
|
-
- 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
|
|
290
|
-
|
|
291
|
-
## 1.45.0-rc.3
|
|
292
|
-
|
|
293
|
-
### Minor Changes
|
|
294
|
-
|
|
295
|
-
- 948eb42: ZERO-2852: Add out of stock endpoints
|
|
296
|
-
|
|
297
|
-
## 1.45.0-rc.2
|
|
298
|
-
|
|
299
|
-
### Minor Changes
|
|
300
|
-
|
|
301
|
-
- c45b62c: ZERO-2818: Add upload and download support for b2b package
|
|
302
|
-
- f2c325c: ZERO-2838: Move file input component into @akinon/next
|
|
303
|
-
|
|
304
|
-
## 1.45.0-rc.1
|
|
305
|
-
|
|
306
|
-
### Minor Changes
|
|
307
|
-
|
|
308
|
-
- 7e56d6b: ZERO-2841: Update api tagTypes
|
|
309
|
-
|
|
310
|
-
## 1.45.0-rc.0
|
|
311
|
-
|
|
312
|
-
### Minor Changes
|
|
313
|
-
|
|
314
|
-
- 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
|
|
315
|
-
- 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
|
|
316
|
-
- a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
|
|
317
|
-
- fda5b92: ZERO-2725: fix invalid import
|
|
318
|
-
- 2d9b2b2: ZERO-2816: Add segment to headers
|
|
319
|
-
- c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
|
|
320
|
-
- 8d9ac9a: ZERO-2794: Add field to order type
|
|
321
|
-
- 70279e7: ZERO-2817: Add metrics endpoint in default middleware
|
|
322
|
-
- 6c25f66: ZERO-2551: Check CACHE_HOST variable
|
|
323
|
-
- bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
|
|
324
|
-
- 3bf2dd9: ZERO-2551: Fix search page
|
|
325
|
-
- e9541a1: ZERO-2816: Add headers to url
|
|
326
|
-
- c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
|
|
327
|
-
- 9d94f7e: ZERO-2820: update parent pk usage for menu generator
|
|
328
|
-
- 64699d3: ZERO-2761: Fix invalid import for plugin module
|
|
329
|
-
- 0d3a913: ZERO-2725: Update decimal scale in Price component
|
|
330
|
-
- 1448a96: ZERO-2612: add errors type in CheckoutState
|
|
331
73
|
- 2ab6e08: ZERO-2841: Update getBasketDetail query
|
|
332
|
-
- d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
|
|
333
|
-
- d3474c6: ZERO-2655: Add data source shipping option
|
|
334
|
-
- 75080fd: ZERO-2630: Add max limit to postcode area
|
|
335
|
-
- 17f8752: ZERO-2816: Make the incoming currency lowercase
|
|
336
|
-
- 91265bb: ZERO-2551: Improve pretty url and caching performance
|
|
337
|
-
- bbe18b9: ZERO-2575: Fix build error
|
|
338
|
-
- d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
|
|
339
|
-
- 4920742: Disable getCachedTranslations
|
|
340
|
-
- 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
|
|
341
|
-
- 98bb8dc: ZERO-2706: Cache getTranlations method
|
|
342
|
-
- 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
|
|
343
|
-
- dcc8a15: ZERO-2694: added build step to RC branch pipeline
|
|
344
|
-
- fad2768: ZERO-2739: add gpay to payment plugin map
|
|
345
|
-
- dff0d59: ZERO-2659: add formData support to proxy api requests
|
|
346
|
-
- eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
|
|
347
|
-
- 9e25a64: ZERO-2835: Update category page layout with breadcrumb
|
|
348
|
-
- beb499e: ZERO-2551: Add new tsconfig paths
|
|
349
|
-
- 146ea39: ZERO-2774: Update imports
|
|
350
|
-
- f2c92d5: ZERO-2816: Update cookie name
|
|
351
|
-
- 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
|
|
352
|
-
- c47be30: ZERO-2744: Update Order and OrderItem types
|
|
353
|
-
- e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
|
|
354
|
-
- f046f8e0: ZERO-2575: update version for react-number-format
|
|
355
|
-
- 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
|
|
356
|
-
- 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
|
|
357
74
|
|
|
358
75
|
## 1.44.0
|
|
359
76
|
|
|
@@ -361,201 +78,7 @@
|
|
|
361
78
|
|
|
362
79
|
### Minor Changes
|
|
363
80
|
|
|
364
|
-
- 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
|
|
365
|
-
- 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
|
|
366
|
-
- a4c8d6a9: ZERO-2663: Fix the image url for gif and svgs and return them without options
|
|
367
|
-
- fda5b92: ZERO-2725: fix invalid import
|
|
368
|
-
- 2d9b2b2: ZERO-2816: Add segment to headers
|
|
369
|
-
- c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
|
|
370
|
-
- 8d9ac9a: ZERO-2794: Add field to order type
|
|
371
|
-
- 70279e7: ZERO-2817: Add metrics endpoint in default middleware
|
|
372
|
-
- 6c25f66: ZERO-2551: Check CACHE_HOST variable
|
|
373
|
-
- bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
|
|
374
|
-
- 3bf2dd9: ZERO-2551: Fix search page
|
|
375
|
-
- e9541a1: ZERO-2816: Add headers to url
|
|
376
|
-
- c53ef7b9: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
|
|
377
|
-
- 9d94f7e: ZERO-2820: update parent pk usage for menu generator
|
|
378
|
-
- 64699d3: ZERO-2761: Fix invalid import for plugin module
|
|
379
|
-
- 0d3a913: ZERO-2725: Update decimal scale in Price component
|
|
380
|
-
- 1448a96: ZERO-2612: add errors type in CheckoutState
|
|
381
|
-
- d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
|
|
382
|
-
- d3474c6: ZERO-2655: Add data source shipping option
|
|
383
|
-
- 75080fd: ZERO-2630: Add max limit to postcode area
|
|
384
|
-
- 17f8752: ZERO-2816: Make the incoming currency lowercase
|
|
385
|
-
- 91265bb: ZERO-2551: Improve pretty url and caching performance
|
|
386
|
-
- bbe18b9: ZERO-2575: Fix build error
|
|
387
|
-
- d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
|
|
388
|
-
- 4920742: Disable getCachedTranslations
|
|
389
|
-
- 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
|
|
390
|
-
- 98bb8dc: ZERO-2706: Cache getTranlations method
|
|
391
|
-
- 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
|
|
392
|
-
- dcc8a15: ZERO-2694: added build step to RC branch pipeline
|
|
393
|
-
- fad2768: ZERO-2739: add gpay to payment plugin map
|
|
394
|
-
- dff0d59: ZERO-2659: add formData support to proxy api requests
|
|
395
|
-
- eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
|
|
396
|
-
- 9e25a64: ZERO-2835: Update category page layout with breadcrumb
|
|
397
|
-
- beb499e: ZERO-2551: Add new tsconfig paths
|
|
398
|
-
- 146ea39: ZERO-2774: Update imports
|
|
399
|
-
- f2c92d5: ZERO-2816: Update cookie name
|
|
400
|
-
- 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
|
|
401
|
-
- c47be30: ZERO-2744: Update Order and OrderItem types
|
|
402
|
-
- e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
|
|
403
|
-
- f046f8e0: ZERO-2575: update version for react-number-format
|
|
404
|
-
- 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
|
|
405
|
-
- 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
|
|
406
|
-
|
|
407
|
-
## 1.43.0-rc.15
|
|
408
|
-
|
|
409
|
-
## 1.43.0-rc.14
|
|
410
|
-
|
|
411
|
-
### Minor Changes
|
|
412
|
-
|
|
413
|
-
- 3bf2dd9: ZERO-2551: Fix search page
|
|
414
|
-
|
|
415
|
-
## 1.43.0-rc.13
|
|
416
|
-
|
|
417
|
-
### Minor Changes
|
|
418
|
-
|
|
419
|
-
- 9e25a64: ZERO-2835: Update category page layout with breadcrumb
|
|
420
|
-
|
|
421
|
-
## 1.43.0-rc.12
|
|
422
|
-
|
|
423
|
-
### Minor Changes
|
|
424
|
-
|
|
425
|
-
- 4920742: Disable getCachedTranslations
|
|
426
|
-
|
|
427
|
-
## 1.43.0-rc.11
|
|
428
|
-
|
|
429
|
-
### Minor Changes
|
|
430
|
-
|
|
431
|
-
- 6c25f66: ZERO-2551: Check CACHE_HOST variable
|
|
432
|
-
|
|
433
|
-
## 1.43.0-rc.10
|
|
434
|
-
|
|
435
|
-
### Minor Changes
|
|
436
|
-
|
|
437
|
-
- d6edb1d: ZERO-2551: Fix searchparams handling for list and other routes
|
|
438
|
-
|
|
439
|
-
## 1.43.0-rc.9
|
|
440
|
-
|
|
441
|
-
### Minor Changes
|
|
442
|
-
|
|
443
|
-
- bc2b411: ZERO-2825: Add attribute-based shipping options to checkout page
|
|
444
|
-
|
|
445
|
-
## 1.43.0-rc.8
|
|
446
|
-
|
|
447
|
-
### Minor Changes
|
|
448
|
-
|
|
449
|
-
- 70279e7: ZERO-2817: Add metrics endpoint in default middleware
|
|
450
|
-
- 9d94f7e: ZERO-2820: update parent pk usage for menu generator
|
|
451
|
-
|
|
452
|
-
## 1.43.0-rc.7
|
|
453
|
-
|
|
454
|
-
### Minor Changes
|
|
455
|
-
|
|
456
|
-
- 7bd3d99: ZERO-2801: Refactor locale middleware to handle single locale configuration
|
|
457
|
-
|
|
458
|
-
## 1.43.0-rc.6
|
|
459
|
-
|
|
460
|
-
### Minor Changes
|
|
461
|
-
|
|
462
|
-
- 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
|
|
463
|
-
- 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
|
|
464
|
-
- a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
|
|
465
|
-
- fda5b92: ZERO-2725: fix invalid import
|
|
466
|
-
- 2d9b2b2: ZERO-2816: Add segment to headers
|
|
467
|
-
- c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
|
|
468
|
-
- 8d9ac9a: ZERO-2794: Add field to order type
|
|
469
|
-
- e9541a1: ZERO-2816: Add headers to url
|
|
470
|
-
- c53ef7b: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
|
|
471
|
-
- 64699d3: ZERO-2761: Fix invalid import for plugin module
|
|
472
|
-
- 0d3a913: ZERO-2725: Update decimal scale in Price component
|
|
473
|
-
- 1448a96: ZERO-2612: add errors type in CheckoutState
|
|
474
|
-
- d3474c6: ZERO-2655: Add data source shipping option
|
|
475
|
-
- 75080fd: ZERO-2630: Add max limit to postcode area
|
|
476
|
-
- 17f8752: ZERO-2816: Make the incoming currency lowercase
|
|
477
|
-
- 91265bb: ZERO-2551: Improve pretty url and caching performance
|
|
478
|
-
- bbe18b9: ZERO-2575: Fix build error
|
|
479
|
-
- d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
|
|
480
|
-
- 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
|
|
481
|
-
- 98bb8dc: ZERO-2706: Cache getTranlations method
|
|
482
|
-
- 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
|
|
483
|
-
- dcc8a15: ZERO-2694: added build step to RC branch pipeline
|
|
484
|
-
- fad2768: ZERO-2739: add gpay to payment plugin map
|
|
485
|
-
- dff0d59: ZERO-2659: add formData support to proxy api requests
|
|
486
|
-
- eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
|
|
487
81
|
- 4a163f2: ZERO-2761: Add condition for basket summary
|
|
488
|
-
- beb499e: ZERO-2551: Add new tsconfig paths
|
|
489
|
-
- 146ea39: ZERO-2774: Update imports
|
|
490
|
-
- f2c92d5: ZERO-2816: Update cookie name
|
|
491
|
-
- c47be30: ZERO-2744: Update Order and OrderItem types
|
|
492
|
-
- e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
|
|
493
|
-
- f046f8e: ZERO-2575: update version for react-number-format
|
|
494
|
-
- 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
|
|
495
|
-
- 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
|
|
496
|
-
|
|
497
|
-
## 1.43.0-rc.5
|
|
498
|
-
|
|
499
|
-
### Minor Changes
|
|
500
|
-
|
|
501
|
-
- 17f8752: ZERO-2816: Make the incoming currency lowercase
|
|
502
|
-
|
|
503
|
-
## 1.43.0-rc.4
|
|
504
|
-
|
|
505
|
-
### Minor Changes
|
|
506
|
-
|
|
507
|
-
- 3f9b8d7: ZERO-2761: Update plugins.js for akinon-next
|
|
508
|
-
|
|
509
|
-
## 1.43.0-rc.3
|
|
510
|
-
|
|
511
|
-
### Minor Changes
|
|
512
|
-
|
|
513
|
-
- 64699d3: ZERO-2761: Fix invalid import for plugin module
|
|
514
|
-
|
|
515
|
-
## 1.43.0-rc.2
|
|
516
|
-
|
|
517
|
-
### Minor Changes
|
|
518
|
-
|
|
519
|
-
- f2c92d5: ZERO-2816: Update cookie name
|
|
520
|
-
|
|
521
|
-
## 1.43.0-rc.1
|
|
522
|
-
|
|
523
|
-
### Minor Changes
|
|
524
|
-
|
|
525
|
-
- eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
|
|
526
|
-
|
|
527
|
-
## 1.43.0-rc.0
|
|
528
|
-
|
|
529
|
-
### Minor Changes
|
|
530
|
-
|
|
531
|
-
- 90282b5: ZERO-2729: Audit packages for yarn and npm and also update app-template
|
|
532
|
-
- 572d2e8: ZERO-2667: Add iframe support for redirection payment methods
|
|
533
|
-
- a4c8d6a: ZERO-2663: Fix the image url for gif and svgs and return them without options
|
|
534
|
-
- fda5b92: ZERO-2725: fix invalid import
|
|
535
|
-
- 2d9b2b2: ZERO-2816: Add segment to headers
|
|
536
|
-
- c53ea3e: ZERO-2609: Reset additional form fields when selectedFormType is not company
|
|
537
|
-
- 8d9ac9a: ZERO-2794: Add field to order type
|
|
538
|
-
- e9541a1: ZERO-2816: Add headers to url
|
|
539
|
-
- c53ef7b: ZERO-2668: The Link component has been updated to improve the logic for handling href values. Previously, if the href was not a string or started with 'http', it would return the href as is. Now, if the href is not provided, it will default to '#' to prevent any potential errors. Additionally, if the href is a string and does not start with 'http', it will be formatted with the locale and pathname, based on the localeUrlStrategy and defaultLocaleValue. This ensures that the correct href is generated based on the localization settings.
|
|
540
|
-
- 0d3a913: ZERO-2725: Update decimal scale in Price component
|
|
541
|
-
- 1448a96: ZERO-2612: add errors type in CheckoutState
|
|
542
|
-
- d3474c6: ZERO-2655: Add data source shipping option
|
|
543
|
-
- 75080fd: ZERO-2630: Add max limit to postcode area
|
|
544
|
-
- 91265bb: ZERO-2551: Improve pretty url and caching performance
|
|
545
|
-
- bbe18b9: ZERO-2575: Fix build error
|
|
546
|
-
- d409996: ZERO-2781: Refactor buildClientRequestUrl function to support caching and options
|
|
547
|
-
- 94b6928: ZERO-2551: Add cache handler check in url-redirection middleware
|
|
548
|
-
- 98bb8dc: ZERO-2706: Cache getTranlations method
|
|
549
|
-
- 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
|
|
550
|
-
- dcc8a15: ZERO-2694: added build step to RC branch pipeline
|
|
551
|
-
- fad2768: ZERO-2739: add gpay to payment plugin map
|
|
552
|
-
- dff0d59: ZERO-2659: add formData support to proxy api requests
|
|
553
|
-
- beb499e: ZERO-2551: Add new tsconfig paths
|
|
554
|
-
- 146ea39: ZERO-2774: Update imports
|
|
555
|
-
- c47be30: ZERO-2744: Update Order and OrderItem types
|
|
556
|
-
- e9a46ac: ZERO-2738: add CVC input to registered cards in Masterpass
|
|
557
|
-
- f046f8e: ZERO-2575: update version for react-number-format
|
|
558
|
-
- 86d2531: ZERO-2693: resolve dependency collision warning for eslint-config-next
|
|
559
82
|
|
|
560
83
|
## 1.42.0
|
|
561
84
|
|
package/api/client.ts
CHANGED
|
@@ -4,7 +4,6 @@ import settings from 'settings';
|
|
|
4
4
|
import logger from '../utils/log';
|
|
5
5
|
import formatCookieString from '../utils/format-cookie-string';
|
|
6
6
|
import cookieParser from 'set-cookie-parser';
|
|
7
|
-
import { cookies } from 'next/headers';
|
|
8
7
|
|
|
9
8
|
interface RouteParams {
|
|
10
9
|
params: {
|
|
@@ -52,24 +51,18 @@ async function proxyRequest(...args) {
|
|
|
52
51
|
extraHeaders[key.toLowerCase()] = value;
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
|
|
54
|
+
[
|
|
56
55
|
'x-forwarded-host',
|
|
57
56
|
'x-forwarded-proto',
|
|
58
57
|
'x-forwarded-port',
|
|
59
58
|
'x-requested-with',
|
|
60
59
|
'origin',
|
|
60
|
+
'host',
|
|
61
61
|
'referer',
|
|
62
62
|
'accept',
|
|
63
63
|
'content-length',
|
|
64
|
-
'content-type'
|
|
65
|
-
|
|
66
|
-
];
|
|
67
|
-
|
|
68
|
-
excludedHeaders.forEach((header) => {
|
|
69
|
-
if (!settings.includedProxyHeaders?.includes(header)) {
|
|
70
|
-
delete extraHeaders[header];
|
|
71
|
-
}
|
|
72
|
-
});
|
|
64
|
+
'content-type'
|
|
65
|
+
].forEach((header) => delete extraHeaders[header]);
|
|
73
66
|
|
|
74
67
|
const fetchOptions = {
|
|
75
68
|
method: req.method,
|
|
@@ -81,33 +74,16 @@ async function proxyRequest(...args) {
|
|
|
81
74
|
}
|
|
82
75
|
} as RequestInit;
|
|
83
76
|
|
|
84
|
-
const nextCookies = cookies();
|
|
85
|
-
const segment = nextCookies.get('pz-segment')?.value;
|
|
86
|
-
const currency = nextCookies.get('pz-external-currency')?.value;
|
|
87
|
-
|
|
88
|
-
if (segment) {
|
|
89
|
-
fetchOptions.headers['X-Segment-Id'] = segment;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (currency) {
|
|
93
|
-
fetchOptions.headers = Object.assign({}, fetchOptions.headers, {
|
|
94
|
-
'x-currency': currency
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
77
|
if (options.contentType) {
|
|
99
78
|
fetchOptions.headers['Content-Type'] = options.contentType;
|
|
100
79
|
}
|
|
101
80
|
|
|
102
|
-
const isMultipartFormData = req.headers
|
|
103
|
-
.get('content-type')
|
|
104
|
-
?.includes('multipart/form-data;');
|
|
105
|
-
|
|
106
81
|
if (req.method !== 'GET') {
|
|
107
|
-
|
|
82
|
+
const formData = new URLSearchParams();
|
|
83
|
+
let body = {};
|
|
108
84
|
|
|
109
85
|
try {
|
|
110
|
-
body =
|
|
86
|
+
body = await req.json();
|
|
111
87
|
} catch (error) {
|
|
112
88
|
logger.error(
|
|
113
89
|
`Client Proxy Request - Error while parsing request body to JSON`,
|
|
@@ -118,25 +94,13 @@ async function proxyRequest(...args) {
|
|
|
118
94
|
);
|
|
119
95
|
}
|
|
120
96
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
Object.keys(body ?? {}).forEach((key) => {
|
|
127
|
-
if (body[key]) {
|
|
128
|
-
if (typeof body[key] === 'object' && body[key] !== null) {
|
|
129
|
-
formData.append(key, JSON.stringify(body[key]));
|
|
130
|
-
} else {
|
|
131
|
-
formData.append(key, body[key]);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
});
|
|
97
|
+
Object.keys(body ?? {}).forEach((key) => {
|
|
98
|
+
if (body[key]) {
|
|
99
|
+
formData.append(key, body[key]);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
135
102
|
|
|
136
|
-
|
|
137
|
-
? JSON.stringify(body)
|
|
138
|
-
: formData;
|
|
139
|
-
}
|
|
103
|
+
fetchOptions.body = !options.useFormData ? JSON.stringify(body) : formData;
|
|
140
104
|
}
|
|
141
105
|
|
|
142
106
|
let url = `${commerceUrl}/${slug.replace(/,/g, '/')}`;
|
|
@@ -152,8 +116,11 @@ async function proxyRequest(...args) {
|
|
|
152
116
|
try {
|
|
153
117
|
const request = await fetch(url, fetchOptions);
|
|
154
118
|
|
|
119
|
+
// Using NextResponse.json with status 204 will cause an error
|
|
155
120
|
if (request.status === 204) {
|
|
156
|
-
return new Response(null, {
|
|
121
|
+
return new Response(null, {
|
|
122
|
+
status: 204
|
|
123
|
+
});
|
|
157
124
|
}
|
|
158
125
|
|
|
159
126
|
let response = {} as any;
|