🔥 Remove unnecesary assert on get-profile rpc method

This commit is contained in:
Andrey Antukh 2023-11-23 12:53:08 +01:00
parent 9773aae5b6
commit 79d9d79737

View file

@ -37,7 +37,7 @@
(declare strip-private-attrs)
(declare verify-password)
(def schema:profile
(def ^:private schema:profile
[:map {:title "Profile"}
[:id ::sm/uuid]
[:fullname [::sm/word-string {:max 250}]]
@ -53,14 +53,12 @@
[:props {:optional true}
[:map-of {:title "ProfileProps"} :keyword :any]]])
(def valid-profile?
(sm/pred-fn schema:profile))
;; --- QUERY: Get profile (own)
(sv/defmethod ::get-profile
{::rpc/auth false
::doc/added "1.18"
::sm/params [:map]
::sm/result schema:profile}
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id]}]
;; We need to return the anonymous profile object in two cases, when
@ -93,10 +91,6 @@
::sm/result schema:profile}
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id fullname lang theme] :as params}]
(dm/assert!
"expected valid profile data"
(valid-profile? params))
(db/with-atomic [conn pool]
;; NOTE: we need to retrieve the profile independently if we use
;; it or not for explicit locking and avoid concurrent updates of