diff --git a/common/src/app/common/schema.cljc b/common/src/app/common/schema.cljc index b6f1a49c4..cb84052d0 100644 --- a/common/src/app/common/schema.cljc +++ b/common/src/app/common/schema.cljc @@ -390,17 +390,16 @@ (register! :merge (mu/-merge)) (register! :union (mu/-union)) -(def uuid-rx - #"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$") - -(defn parse-uuid +(defn- parse-uuid [s] - (try - (uuid/parse s) - (catch #?(:clj Exception :cljs :default) _cause - s))) + (if (str/empty? s) + nil + (try + (uuid/parse s) + (catch #?(:clj Exception :cljs :default) _cause + s)))) -(defn encode-uuid +(defn- encode-uuid [v] (when (uuid? v) (str v)))