From ab7e8497deaf44be82333961f8b1b98d9ab562fc Mon Sep 17 00:00:00 2001 From: Drew Larson Date: Mon, 30 Jan 2017 09:08:03 -0600 Subject: [PATCH] Add catch. --- .../assets/js/bikes/components/BikeForm/index.jsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bikeshop_project/assets/js/bikes/components/BikeForm/index.jsx b/bikeshop_project/assets/js/bikes/components/BikeForm/index.jsx index cc29acb..06462c7 100644 --- a/bikeshop_project/assets/js/bikes/components/BikeForm/index.jsx +++ b/bikeshop_project/assets/js/bikes/components/BikeForm/index.jsx @@ -1,13 +1,13 @@ import Checkbox from 'material-ui/Checkbox'; -import fetch from 'isomorphic-fetch'; +import Cookies from 'js-cookie'; import FlatButton from 'material-ui/FlatButton'; -import moment from 'moment-timezone'; import RaisedButton from 'material-ui/RaisedButton'; import React from 'react'; import TextField from 'material-ui/TextField'; +import fetch from 'isomorphic-fetch'; +import moment from 'moment-timezone'; import Source from '../Source'; import Size from '../Size'; -import Cookies from 'js-cookie'; const styles = { block: { @@ -65,7 +65,8 @@ class BikeForm extends React.Component { if (response.status >= 400) { throw new Error('Bad response from server'); } - console.log(response.json()); + }).catch((error) => { + console.error(error); }); } @@ -226,8 +227,9 @@ class BikeForm extends React.Component {
-
- +
+ +
);