Skip to content
Snippets Groups Projects
Commit c1da1e7c authored by Miska Sulander's avatar Miska Sulander
Browse files

app fully working

parent ef53b79c
Branches main
No related tags found
No related merge requests found
...@@ -51,16 +51,15 @@ class App extends React.Component { ...@@ -51,16 +51,15 @@ class App extends React.Component {
// Remove person // Remove person
removePerson = (id) => { removePerson = (id) => {
const url = baseUrl + {id} const url = baseUrl + id
const person = this.state.persons.find(p => p.id === id) const person = this.state.persons.find(p => p.id === id)
if (window.confirm(`Do you really want to delete ${person.name}?`)) { if (window.confirm(`Do you really want to delete ${person.name}?`)) {
this.setState({ this.setState({
persons: this.state.persons.filter(function (p) { return p.id !== id }) persons: this.state.persons.filter(function (p) { return p.id !== id })
}) })
axios axios
.delete(url, person) .delete(url, id)
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment