 (ns hatnik.web.client.z-actions
   (:require [jayq.core :as jq]
             [hatnik.web.client.app-state :as state]
-            [hatnik.web.client.message :as msg])
+            [hatnik.web.client.message :as msg]
+            [hatnik.schema :as schm]
+            [schema.core :as s])
   (:use [jayq.core :only [$]]))
 
 (defn get-data-from-input [id]

       #(common-update-callback "Project don't deleted!" {} %))))

(defn ^:export update-project [project-id new-name]
  (.modal ($ :#iModalProjectMenu) "hide")
  (ajax
   (str "/api/projects/" project-id) "PUT"
   {:name new-name} 
   (wrap-error-alert #(common-update-callback "Project don't renamed!" {} %))))


(defn get-library [library callback]


(defn ^:export send-new-project-request []
  (let [name (.-value (.getElementById js/document "project-name-input"))]
    (if (s/check schm/Project {:name name})
      (msg/danger "Project name must be not empty!")
      (do
        (.modal ($ :#iModalProject) "hide")
