Browse Source

Add catch.

feature/bike-tracking
Drew Larson 8 years ago
parent
commit
ab7e8497de
  1. 12
      bikeshop_project/assets/js/bikes/components/BikeForm/index.jsx

12
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,10 +227,11 @@ class BikeForm extends React.Component {
</div>
</div>
<div className="mdl-grid">
<div className="mdl-cell right"></div>
<div className="mdl-cell right">
<RaisedButton label="Save" onTouchTap={this.handleSave} />
</div>
</div>
</div>
);
}
}

Loading…
Cancel
Save