 
 (defn render-add-list
   "Render the text field allowing to add new tasks to a card"
-  [card-id]
+  [card]
   [:input.checklist--add-task
    {:type "text"
     :placeholder "Type then hit Enter to add a task"
-    :on-key-press (fn [e]
-                    (when (= "Enter" (.-key e))
-                      (add-task-to! card-id (.. e -target -value))
-                      (set! (.. e -target -value) "")
-                  ))
+    :on-key-press
+    (fn [e]
+      (when (= "Enter" (.-key e))
+        (update-card! (api/add-task card (.. e -target -value)))
+        (set! (.. e -target -value) "")
+        ))
     }])
 
 (defn render-card


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; TODO - Separate concerns!
; Model at the end:
; - A map id to card
; - Collections for each status: each holding the list of IDs they have
; - Use a reaction to provide for the filtered list of cards (filtered by text)

(def app-state
  (r/atom
    {:cards {}

  [:div.checklist
   [:ul
    (for [t tasks]
      [render-task card-id t])]
  ])

(defn card-side-color
