diff --git a/frontend/uxbox/data/workspace.cljs b/frontend/uxbox/data/workspace.cljs index 741b64edb..0eb6635ac 100644 --- a/frontend/uxbox/data/workspace.cljs +++ b/frontend/uxbox/data/workspace.cljs @@ -91,11 +91,10 @@ (-apply-update [_ state] (assoc-in state [:workspace :selected] #{})))) -;; TODO: validate shape - (defn add-shape "Mark a shape selected for drawing in the canvas." [shape props] + (sc/validate! +shape-schema+ shape) (sc/validate! +shape-props-schema+ props) (reify rs/UpdateEvent diff --git a/frontend/uxbox/schema.cljs b/frontend/uxbox/schema.cljs index 2ce54c44a..d9f355e4e 100644 --- a/frontend/uxbox/schema.cljs +++ b/frontend/uxbox/schema.cljs @@ -1,7 +1,8 @@ (ns uxbox.schema - (:refer-clojure :exclude [keyword uuid]) + (:refer-clojure :exclude [keyword uuid vector]) (:require [bouncer.core :as b] - [bouncer.validators :as v])) + [bouncer.validators :as v] + [uxbox.shapes :refer (shape?)])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Validators