             [catacumba.http :as http]
             [storages.core :as st]
             [uxbox.media :as media]
+            [uxbox.images :as images]
             [uxbox.schema :as us]
             [uxbox.services :as sv]
             [uxbox.services.images :as si]
             [uxbox.util.response :refer (rsp)]
             [uxbox.util.uuid :as uuid]
             [uxbox.util.paths :as paths]))
+
+;; --- Constants & Config
 
 (def validate-form! (partial us/validate! :form/validation))
 (def validate-query! (partial us/validate! :query/validation))

        filename (paths/base-name file)
        extension (paths/extension filename)
        storage media/images-storage]
    (->> (st/save storage filename file)
         (p/mapcat (fn [path]
                     (sv/novelty {:id id
                                  :type :create/image
                                  :user user
                                  :name filename
                                  :path (str path)})))
         (p/map resolve-path)
         (p/map (fn [result]
                  (let [loc (str "/api/library/images/" (:id result))]
                    (http/created loc (rsp result))))))))

;; --- Update Image


    (-> (sv/query params)
        (p/then #(http/ok (rsp %))))))

;; --- Create image

(def create-image-schema
  {:id [us/uuid]
   :file [us/required us/uploaded-file]})

(defn create-image
  [{user :identity data :data}]
