                     (let [cards (map #(str (:qty %) " " (:card %)) (:cards deck))]
                       (assoc deck :cards (parse-deck (join "\n" cards)))))]
         (swap! app-state assoc :decks decks))))
-
-
-(println (:decks @app-state))

    (go (let [response (<! (POST "/data/decks/" data :json))]))))

(defn handle-edit [event owner]
  (let [deck (-> owner (om/get-node "deck-edit") .-value)]
    (om/set-state! owner [:deck :cards] (parse-deck deck))))

(defn decklist-view [{:keys [name identity cards]} owner]
  (om/component

             [:input.lookup {:type "text" :placeholder "Card" :value (:card-search state)}] " x "
             [:input.qty {:type "text" :value (:quantity state)}]
             [:button {:on-click #()} "Add"]]
            [:textarea {:ref "deck-edit" :value (:deck-edit state)
                        :on-change #(handle-edit % owner)}]]]]]]))))

(om/root deck-builder app-state {:target (. js/document (getElementById "deckbuilder"))})

