@akinon/next 1.54.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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
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
|
|
9
|
+
- eecb282: ZERO-2607: Update address-related functions to include invalidateTag option
|
|
10
|
+
|
|
3
11
|
## 1.54.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/data/client/address.ts
CHANGED
|
@@ -39,7 +39,10 @@ const addressApi = api.injectEndpoints({
|
|
|
39
39
|
query: (city) =>
|
|
40
40
|
buildClientRequestUrl(address.getRetailStoreTownships(city))
|
|
41
41
|
}),
|
|
42
|
-
addAddress: builder.mutation<
|
|
42
|
+
addAddress: builder.mutation<
|
|
43
|
+
Address,
|
|
44
|
+
Partial<Address> & { invalidateTag?: 'Addresses' | 'Checkout' }
|
|
45
|
+
>({
|
|
43
46
|
query: (body) => ({
|
|
44
47
|
url: buildClientRequestUrl(address.base, {
|
|
45
48
|
contentType: 'application/json'
|
|
@@ -50,9 +53,16 @@ const addressApi = api.injectEndpoints({
|
|
|
50
53
|
type: body.is_corporate === 'true' ? 'corporate' : 'personal'
|
|
51
54
|
}
|
|
52
55
|
}),
|
|
53
|
-
invalidatesTags: (_, error) =>
|
|
56
|
+
invalidatesTags: (_, error, arg) => {
|
|
57
|
+
if (error) return [];
|
|
58
|
+
if (arg.invalidateTag) return [arg.invalidateTag];
|
|
59
|
+
return ['Addresses', 'Checkout'];
|
|
60
|
+
}
|
|
54
61
|
}),
|
|
55
|
-
editAddress: builder.mutation<
|
|
62
|
+
editAddress: builder.mutation<
|
|
63
|
+
Address,
|
|
64
|
+
Partial<Address> & { invalidateTag?: 'Addresses' | 'Checkout' }
|
|
65
|
+
>({
|
|
56
66
|
query: ({ pk, ...body }) => ({
|
|
57
67
|
url: buildClientRequestUrl(address.editAddress(pk), {
|
|
58
68
|
contentType: 'application/json'
|
|
@@ -64,14 +74,28 @@ const addressApi = api.injectEndpoints({
|
|
|
64
74
|
type: body.is_corporate === 'true' ? 'corporate' : 'personal'
|
|
65
75
|
}
|
|
66
76
|
}),
|
|
67
|
-
invalidatesTags: (_, error
|
|
77
|
+
invalidatesTags: (_, error, arg) => {
|
|
78
|
+
if (error) return [];
|
|
79
|
+
if (arg.invalidateTag) return [arg.invalidateTag];
|
|
80
|
+
return ['Addresses', 'Checkout'];
|
|
81
|
+
}
|
|
68
82
|
}),
|
|
69
|
-
removeAddress: builder.mutation<
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
removeAddress: builder.mutation<
|
|
84
|
+
void,
|
|
85
|
+
number | { id: number; invalidateTag: 'Addresses' | 'Checkout' }
|
|
86
|
+
>({
|
|
87
|
+
query: (arg) => ({
|
|
88
|
+
url: buildClientRequestUrl(
|
|
89
|
+
address.removeAddress(typeof arg === 'number' ? arg : arg.id)
|
|
90
|
+
),
|
|
72
91
|
method: 'DELETE'
|
|
73
92
|
}),
|
|
74
|
-
invalidatesTags: (_, error
|
|
93
|
+
invalidatesTags: (_, error, arg) => {
|
|
94
|
+
if (error) return [];
|
|
95
|
+
if (typeof arg === 'object' && arg.invalidateTag)
|
|
96
|
+
return [arg.invalidateTag];
|
|
97
|
+
return ['Addresses', 'Checkout'];
|
|
98
|
+
}
|
|
75
99
|
}),
|
|
76
100
|
setDefaultAddress: builder.mutation<Address, Partial<Address>>({
|
|
77
101
|
query: ({ pk, primary }) => ({
|
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.
|
|
4
|
+
"version": "1.55.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"set-cookie-parser": "2.6.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@akinon/eslint-plugin-projectzero": "1.
|
|
32
|
+
"@akinon/eslint-plugin-projectzero": "1.55.0",
|
|
33
33
|
"@types/react-redux": "7.1.30",
|
|
34
34
|
"@types/set-cookie-parser": "2.4.7",
|
|
35
35
|
"@typescript-eslint/eslint-plugin": "6.7.4",
|
package/redux/reducers/config.ts
CHANGED
package/types/commerce/misc.ts
CHANGED