Web Programming

Todo SPA (Finishing)

The objective of this exercise is to extend the todo single-page application so that todos can be completed and deleted.

Tasks

  1. Add the following methods to the service object:
    • patchTodo(id, user) sends an AJAX request to complete the specified todo
    • deleteTodo(id, user) sends an AJAX request to delete the specified todo
  2. Add the following methods to the store object:
    • completeTodo(id) calls the patchTodo service method and updates the todo in the list
    • removeTodo(id) calls the deleteTodo service method and removes the todo from the list
  3. In the TodoList component, add buttons to each rendered todo taht allow the corresponding todo to be completet or deleted.