From 05dbb7c11b1b80377cfef5edf6c20f753a323d14 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Fri, 27 Jul 2018 08:41:07 -0700 Subject: [PATCH] fixing issue with address making it never saveable. --- src/cljc/auto_ap/entities/address.cljc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cljc/auto_ap/entities/address.cljc b/src/cljc/auto_ap/entities/address.cljc index e75eb87b..1614fe0c 100644 --- a/src/cljc/auto_ap/entities/address.cljc +++ b/src/cljc/auto_ap/entities/address.cljc @@ -5,8 +5,10 @@ (s/def ::street1 (s/nilable string?)) (s/def ::street2 (s/nilable string?)) (s/def ::city (s/nilable string?)) -(s/def ::state (s/nilable (s/and string? - #(re-matches #"[a-zA-Z]{2}" %)))) +(s/def ::state (s/nilable (s/or + :empty (s/and string? #{""}) + :filled (s/and string? + #(re-matches #"[a-zA-Z]{2}" %))))) (s/def ::zip (s/nilable string?)) (s/def ::address (s/keys :opt-un [::email