In this project, we'll introduce how to use axios inside of a React project. We'll cover full CRUD in this project ( GET, PUT, POST, DELETE ) and also cover how to use .then(). Majority of the React application will already be built for you. If you're finding it hard to dive into an existing code base and understand exactly what is going on, that's perfectly normal. Try to focus only on how we're interacting with the API using axios.
This project is also incorporating toast notifications to help visualize successful or failed API requests. Therefore when building out our axios requests, we will add an additional line of code for successful and failed API requests.
- Success:
ToastStore.success('Success!', 3000);
- Failure:
ToastStore.error('Failed!', 3000);
Fork
andclone
this repository.cd
into the project directory.- Run
npm install
. - Run
npm start
.
https://app.swaggerhub.com/apis/DevMountain/Joes-Auto/1.0.0
Please reference this API documentation when completing the project steps.
GET
PUT
POST
DELETE
Complete the remaining methods..
If you see a problem or a typo, please fork, make the necessary changes, and create a pull request so we can review your changes and merge them into the master repo and branch.
© DevMountain LLC, 2017. Unauthorized use and/or duplication of this material without express and written permission from DevMountain, LLC is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to DevMountain with appropriate and specific direction to the original content.