@instockng/api-client 1.0.39 → 1.0.40
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.
|
@@ -135,10 +135,8 @@ export function useAddCartItem(cartId, options) {
|
|
|
135
135
|
if (variables.refreshRecommendations) {
|
|
136
136
|
queryClient.invalidateQueries({ queryKey: queryKeys.public.carts.recommendations(cartId) });
|
|
137
137
|
}
|
|
138
|
-
// Refresh upsell addons when
|
|
139
|
-
|
|
140
|
-
queryClient.invalidateQueries({ queryKey: queryKeys.public.carts.upsellAddons(cartId) });
|
|
141
|
-
}
|
|
138
|
+
// Refresh upsell addons when cart changes
|
|
139
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.public.carts.upsellAddons(cartId) });
|
|
142
140
|
},
|
|
143
141
|
...options,
|
|
144
142
|
});
|
|
@@ -161,6 +159,7 @@ export function useUpdateCartItem(cartId, options) {
|
|
|
161
159
|
mutationFn: ({ itemId, quantity }) => updateCartItem(cartId, itemId, quantity),
|
|
162
160
|
onSuccess: () => {
|
|
163
161
|
queryClient.invalidateQueries({ queryKey: queryKeys.public.carts.detail(cartId) });
|
|
162
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.public.carts.upsellAddons(cartId) });
|
|
164
163
|
},
|
|
165
164
|
...options,
|
|
166
165
|
});
|
|
@@ -185,6 +184,7 @@ export function useRemoveCartItem(cartId, options) {
|
|
|
185
184
|
queryClient.invalidateQueries({ queryKey: queryKeys.public.carts.detail(cartId) });
|
|
186
185
|
// Refresh recommendations when item is removed
|
|
187
186
|
queryClient.invalidateQueries({ queryKey: queryKeys.public.carts.recommendations(cartId) });
|
|
187
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.public.carts.upsellAddons(cartId) });
|
|
188
188
|
},
|
|
189
189
|
...options,
|
|
190
190
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instockng/api-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.40",
|
|
4
4
|
"description": "React Query hooks for OMS API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,6 +22,13 @@
|
|
|
22
22
|
"dist",
|
|
23
23
|
"README.md"
|
|
24
24
|
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"type-check": "tsc --noEmit",
|
|
27
|
+
"build": "tsc --project tsconfig.build.json --noEmitOnError false && node scripts/fix-dist.mjs",
|
|
28
|
+
"generate-types": "node scripts/generate-backend-types.mjs",
|
|
29
|
+
"prebuild": "pnpm run generate-types",
|
|
30
|
+
"prepublishOnly": "pnpm run build"
|
|
31
|
+
},
|
|
25
32
|
"keywords": [
|
|
26
33
|
"api",
|
|
27
34
|
"react-query",
|
|
@@ -45,11 +52,5 @@
|
|
|
45
52
|
"axios": "^1.6.5",
|
|
46
53
|
"react": "^19.0.0",
|
|
47
54
|
"typescript": "^5.3.3"
|
|
48
|
-
},
|
|
49
|
-
"scripts": {
|
|
50
|
-
"type-check": "tsc --noEmit",
|
|
51
|
-
"build": "tsc --project tsconfig.build.json --noEmitOnError false && node scripts/fix-dist.mjs",
|
|
52
|
-
"generate-types": "node scripts/generate-backend-types.mjs",
|
|
53
|
-
"prebuild": "pnpm run generate-types"
|
|
54
55
|
}
|
|
55
|
-
}
|
|
56
|
+
}
|