diff --git a/README.md b/README.md index 92a64c8..98a692d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -todo: instructions, better naming, test clone/deploy +todo: instructions, test clone/deploy # Getting Started with Create React App diff --git a/src/App.js b/src/App.js index b236bee..48a664b 100644 --- a/src/App.js +++ b/src/App.js @@ -1,7 +1,7 @@ import './App.css'; import React from 'react'; import axios from 'axios'; -import Person from './components/person.js' +import Contact from './components/contact.js' class App extends React.Component { @@ -9,7 +9,7 @@ class App extends React.Component { contacts: [] } - getPeople = ()=>{ + getContacts = ()=>{ axios .get('https://desolate-thicket-29906.herokuapp.com/api/contacts') .then((response)=>{ @@ -20,32 +20,32 @@ class App extends React.Component { } componentDidMount = ()=>{ - this.getPeople(); + this.getContacts(); } - createUser = (event)=>{ + createContact = (event)=>{ event.preventDefault(); axios .post( 'https://desolate-thicket-29906.herokuapp.com/api/contacts', { - name:this.state.newPersonName, - age:this.state.newPersonAge + name:this.state.newContactName, + age:this.state.newContactAge } ).then(()=>{ - this.getPeople(); + this.getContacts(); }) } - changeNewPersonName = (event)=>{ + changeNewContactName = (event)=>{ this.setState({ - newPersonName: event.target.value + newContactName: event.target.value }) } - changeNewPersonAge = (event)=>{ + changeNewContactAge = (event)=>{ this.setState({ - newPersonAge: event.target.value + newContactAge: event.target.value }) } @@ -58,16 +58,16 @@ class App extends React.Component {