Avoid sending duplicate PUT requests when toggling completion
This commit is contained in:
parent
6d6a950908
commit
1874dc4724
@ -117,7 +117,8 @@ function AddItemForm({ onNewItem }) {
|
||||
function ItemDisplay({ item, onItemUpdate, onItemRemoval }) {
|
||||
const { Container, Row, Col, Button } = ReactBootstrap;
|
||||
|
||||
const toggleCompletion = () => {
|
||||
const toggleCompletion = (event) => {
|
||||
event.stopPropagation()
|
||||
fetch(`/items/${item.id}`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({
|
||||
|
Loading…
Reference in New Issue
Block a user