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