diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-05-07 16:54:27 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-05-07 16:54:27 -0400 |
| commit | c9a2b488c83dcaae0a00d2177d3bfe1f185c28bf (patch) | |
| tree | ee3b0ad93874e434a212b43194286f366f13fbe1 /frontend/components/TakeMyMoney.js | |
| parent | dbd39fcc3861facecdd4413c90ae85cebd5db67f (diff) | |
TEST ESTSE TS ETSETST
Diffstat (limited to 'frontend/components/TakeMyMoney.js')
| -rw-r--r-- | frontend/components/TakeMyMoney.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/frontend/components/TakeMyMoney.js b/frontend/components/TakeMyMoney.js index e8b11f2..fb5f727 100644 --- a/frontend/components/TakeMyMoney.js +++ b/frontend/components/TakeMyMoney.js @@ -5,6 +5,7 @@ import Router from 'next/router'; import NProgress from 'nprogress'; import { CREATE_ORDER_MUTATION, CURRENT_USER_QUERY } from '../queries/queries'; import calcTotalPrice from '../lib/calcTotalPrice'; +import Error from './ErrorMessage'; function totalItems(cart) { return cart.reduce((tally, cartItem) => tally + cartItem.quantity, 0); @@ -29,8 +30,9 @@ class TakeMyMoney extends Component { render() { return ( <Query query={CURRENT_USER_QUERY}> - {({ data: { me } }) => { + {({ data: { me }, error }) => { if (!me || !me.cart.length) return null; + if (error) return <Error error={error} />; return ( <Mutation mutation={CREATE_ORDER_MUTATION} |
