Skip to content

Issue: server crashing when deleting todos #2

@wjfletch26

Description

@wjfletch26

To anyone having issues their server crashing when they're deleting todos

You can fix this by removing the completeTodo onClick event in the .Todo div and putting it in the .checkbox div or .text div instead
<div classname="text" onClick = completeTodo(todo._id)}> ... </div>

I think it's cause the onClick event (the completeTodo PUT request) is in the .Todo div which contains the delete div as chid and that causes two functions to run at the same time when you click on the delete X, the task is deleted then the completeTodo function will try to mark the task as completed or not but the task is now inexistent, so there's nothing to mark, hence the error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions