Commit 2bc86048 authored by Milan Iliev's avatar Milan Iliev

Added IDs

parent 662f407b
......@@ -6,9 +6,9 @@ const router = new Router()
router.get("/tasks", async (context) => {
context.response.body = [
{done: true, description: "Do Laundry" },
{done: false, description: "Do Homework"},
{done: false, description: "Do Chores" },
{id: 1, done: true, description: "Do Laundry" },
{id: 2, done: false, description: "Do Homework"},
{id: 3, done: false, description: "Do Chores" },
]
})
......
......@@ -4,6 +4,10 @@ class Task extends EventTarget {
this.data = data
}
get id(){
return this.data.id
}
get done(){
return this.data.done
}
......@@ -113,7 +117,6 @@ let addTask = function(task){
task_views.push(view)
}
let addButton = document.querySelector('#add_button')
addButton.addEventListener("click", () => {
addTask(new Task({done: false, description: "New Task"}))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment