diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-05-10 10:13:07 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-05-10 10:13:07 -0400 |
| commit | 4823f13c8f6b279c51fe6137ec9cf2574efa521d (patch) | |
| tree | acbe71c69840b7ef1e96e72da69a1d78623c3f9d /frontend | |
| parent | 8ed7d5b734ba588fe0570e0e22f21a0fcda13422 (diff) | |
fix remove from cart mutation
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/README.md | 5 | ||||
| -rw-r--r-- | frontend/components/RemoveFromCart.js | 8 |
2 files changed, 5 insertions, 8 deletions
diff --git a/frontend/README.md b/frontend/README.md index 6c2bd84..9d20e7c 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -1,7 +1,5 @@ # Advanced-React - - <!-- ## Marketing @@ -47,4 +45,5 @@ Things to Ask James: * Testing Error States * wait and loading - normal? --->
\ No newline at end of file +--> + diff --git a/frontend/components/RemoveFromCart.js b/frontend/components/RemoveFromCart.js index 5b451e2..b80f7f7 100644 --- a/frontend/components/RemoveFromCart.js +++ b/frontend/components/RemoveFromCart.js @@ -33,12 +33,10 @@ class RemoveFromCart extends Component { mutation={REMOVE_FROM_CART_MUTATION} variables={{ id: this.props.id }} update={this.update} - // TODO - we should be able to remove this because we remove the item above - // refetchQueries={[{ query: CURRENT_USER_QUERY }]} > - {removeFromCart => ( - <BigButton title="Remove From Cart" onClick={removeFromCart}> - × + {(removeFromCart, { loading }) => ( + <BigButton disabled={loading} title="Remove From Cart" onClick={removeFromCart}> + × </BigButton> )} </Mutation> |
