@graphcommerce/magento-cart-items 9.1.0-canary.50 → 9.1.0-canary.52

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
  # Change Log
2
2
 
3
+ ## 9.1.0-canary.52
4
+
5
+ ## 9.1.0-canary.51
6
+
7
+ ### Patch Changes
8
+
9
+ - [#2537](https://github.com/graphcommerce-org/graphcommerce/pull/2537) [`47daa19`](https://github.com/graphcommerce-org/graphcommerce/commit/47daa19a848acc85b0a9b84e6fda89da92128565) - Solve issue where if a product wasn't available in the cart anymore from the server the user wouldn't be able to remove the item from the cart. ([@paales](https://github.com/paales))
10
+
3
11
  ## 9.1.0-canary.50
4
12
 
5
13
  ## 9.1.0-canary.49
@@ -1,3 +1,4 @@
1
+ import { useApolloClient } from '@graphcommerce/graphql'
1
2
  import { useFormGqlMutationCart } from '@graphcommerce/magento-cart/hooks'
2
3
  import type { UseFormGraphQlOptions } from '@graphcommerce/react-hook-form'
3
4
  import type { DistributedOmit } from 'type-fest'
@@ -17,10 +18,15 @@ export type UseRemoveItemFromCartProps = DistributedOmit<CartItemFragment, '__ty
17
18
  export function useRemoveItemFromCart(props: UseRemoveItemFromCartProps) {
18
19
  const { uid, errors, ...options } = props
19
20
 
20
- const form = useFormGqlMutationCart(RemoveItemFromCartDocument, {
21
- defaultValues: { uid },
22
- ...options,
23
- })
21
+ const client = useApolloClient()
22
+ const form = useFormGqlMutationCart(
23
+ RemoveItemFromCartDocument,
24
+ {
25
+ defaultValues: { uid },
26
+ ...options,
27
+ },
28
+ { onError: () => client.refetchQueries({ include: ['CartPage'] }) },
29
+ )
24
30
 
25
31
  const { handleSubmit } = form
26
32
  const submit = handleSubmit(() => {})
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart-items",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.1.0-canary.50",
5
+ "version": "9.1.0-canary.52",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,19 +12,19 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^9.1.0-canary.50",
16
- "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.50",
17
- "@graphcommerce/framer-next-pages": "^9.1.0-canary.50",
18
- "@graphcommerce/graphql": "^9.1.0-canary.50",
19
- "@graphcommerce/image": "^9.1.0-canary.50",
20
- "@graphcommerce/magento-cart": "^9.1.0-canary.50",
21
- "@graphcommerce/magento-customer": "^9.1.0-canary.50",
22
- "@graphcommerce/magento-product": "^9.1.0-canary.50",
23
- "@graphcommerce/magento-store": "^9.1.0-canary.50",
24
- "@graphcommerce/next-ui": "^9.1.0-canary.50",
25
- "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.50",
26
- "@graphcommerce/react-hook-form": "^9.1.0-canary.50",
27
- "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.50",
15
+ "@graphcommerce/ecommerce-ui": "^9.1.0-canary.52",
16
+ "@graphcommerce/eslint-config-pwa": "^9.1.0-canary.52",
17
+ "@graphcommerce/framer-next-pages": "^9.1.0-canary.52",
18
+ "@graphcommerce/graphql": "^9.1.0-canary.52",
19
+ "@graphcommerce/image": "^9.1.0-canary.52",
20
+ "@graphcommerce/magento-cart": "^9.1.0-canary.52",
21
+ "@graphcommerce/magento-customer": "^9.1.0-canary.52",
22
+ "@graphcommerce/magento-product": "^9.1.0-canary.52",
23
+ "@graphcommerce/magento-store": "^9.1.0-canary.52",
24
+ "@graphcommerce/next-ui": "^9.1.0-canary.52",
25
+ "@graphcommerce/prettier-config-pwa": "^9.1.0-canary.52",
26
+ "@graphcommerce/react-hook-form": "^9.1.0-canary.52",
27
+ "@graphcommerce/typescript-config-pwa": "^9.1.0-canary.52",
28
28
  "@lingui/core": "^4.2.1",
29
29
  "@lingui/macro": "^4.2.1",
30
30
  "@lingui/react": "^4.2.1",