          (= "" email-body))
       (js/alert "Wrong data! Check out fields!")
 
-      (ajax "/api/actions/test" "POST" data (fn [e])))))
-
-(defn wrap-error-alert [callback]
-  (fn [reply]
-    (let [resp (js->clj reply)]
-      (when (= "error" (get resp "result")) (js/alert (get resp "message")))
-      (callback reply))))
+      (ajax "/api/actions/test" "POST" data 
+            (wrap-error-alert (fn [e]))))))
 
 
 (defn common-update-callback [msg data reply]


      (do
        (.modal ($ :#iModal) "hide")
        (ajax "/api/actions" "POST" data #(create-new-email-action-callback data %))))))


(defn test-new-email-action [project-id]

(defn get-data-from-input [id]
  (.-value (.getElementById js/document id)))

(defn wrap-error-alert [callback]
  (fn [reply]
    (let [resp (js->clj reply)]
      (when (= "error" (get resp "result")) (js/alert (get resp "message")))
      (callback reply))))

(defn ajax [url type data callback]
  (jq/ajax url
