 
 (defn submit-idea!
   [doc]
-  (prn doc)
   (db/create-idea! doc))
 
 ;; forms

      (assoc :email "Email is empty")

      (when-let [email (:email person)]
        (nil? (re-find email-regex email)))
      (assoc :email "Email is not valid")

      (nil? (:age person))
      (assoc :age "Age is not set"))))

(defn validate-user!
  "Update errors atom, and return true if there were any errors."
  [doc]
  (let [errors (validate-user @doc)]
    (swap! doc assoc :errors errors)
    (empty? errors)))


(def idea-template
  [:div
   (input "Idea title" :text :title)
   (error-field :title)

   [select-cat-component]
   (error-field :category)

   [:p
    [:textarea.form-control
     {:rows        "4"
      :placeholder "If necessary, add a description"
      :field       :textarea
      :id          :desc}]]

   (for [i (range 3)]
     [:div {:key i}
      (input "URL" :text (str ":urls." i))])])
