@akinon/next 1.81.0-rc.4 → 1.81.0-rc.6

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
@@ -1,5 +1,17 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.81.0-rc.6
4
+
5
+ ### Minor Changes
6
+
7
+ - 40a46853: ZERO-3182: Optimize basket update mutation with optimistic update
8
+
9
+ ## 1.81.0-rc.5
10
+
11
+ ### Minor Changes
12
+
13
+ - 2d2ab446: ZERO-3226: Add device_info param to WalletPaymentPage request
14
+
3
15
  ## 1.81.0-rc.4
4
16
 
5
17
  ### Minor Changes
@@ -84,7 +84,20 @@ export const basketApi = api.injectEndpoints({
84
84
  method: 'PUT',
85
85
  body
86
86
  }),
87
- invalidatesTags: ['MultiBasket', 'Basket']
87
+ async onQueryStarted(_, { dispatch, queryFulfilled }) {
88
+ try {
89
+ const { data } = await queryFulfilled;
90
+ dispatch(
91
+ basketApi.util.updateQueryData(
92
+ 'getBasket',
93
+ undefined,
94
+ () => data.basket
95
+ )
96
+ );
97
+ } catch {
98
+ dispatch(basketApi.util.invalidateTags(['MultiBasket', 'Basket']));
99
+ }
100
+ }
88
101
  }),
89
102
  clearBasket: build.mutation<Basket, void>({
90
103
  query: (body) => ({
@@ -479,15 +479,19 @@ export const checkoutApi = api.injectEndpoints({
479
479
  CheckoutResponse,
480
480
  {
481
481
  payment_token?: string;
482
+ device_info?: {
483
+ [key: string]: any;
484
+ };
482
485
  }
483
486
  >({
484
- query: ({ payment_token }) => ({
487
+ query: ({ payment_token, device_info }) => ({
485
488
  url: buildClientRequestUrl(checkout.setWalletPaymentPage, {
486
489
  useFormData: true
487
490
  }),
488
491
  method: 'POST',
489
492
  body: {
490
- payment_token
493
+ payment_token,
494
+ device_info
491
495
  }
492
496
  }),
493
497
  async onQueryStarted(arg, { dispatch, queryFulfilled }) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@akinon/next",
3
3
  "description": "Core package for Project Zero Next",
4
- "version": "1.81.0-rc.4",
4
+ "version": "1.81.0-rc.6",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "set-cookie-parser": "2.6.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@akinon/eslint-plugin-projectzero": "1.81.0-rc.4",
33
+ "@akinon/eslint-plugin-projectzero": "1.81.0-rc.6",
34
34
  "@types/react-redux": "7.1.30",
35
35
  "@types/set-cookie-parser": "2.4.7",
36
36
  "@typescript-eslint/eslint-plugin": "6.7.4",