mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 14:36:42 +02:00
🔥 Remove unnecesary assert on get-profile rpc method
This commit is contained in:
parent
9773aae5b6
commit
79d9d79737
1 changed files with 2 additions and 8 deletions
|
@ -37,7 +37,7 @@
|
||||||
(declare strip-private-attrs)
|
(declare strip-private-attrs)
|
||||||
(declare verify-password)
|
(declare verify-password)
|
||||||
|
|
||||||
(def schema:profile
|
(def ^:private schema:profile
|
||||||
[:map {:title "Profile"}
|
[:map {:title "Profile"}
|
||||||
[:id ::sm/uuid]
|
[:id ::sm/uuid]
|
||||||
[:fullname [::sm/word-string {:max 250}]]
|
[:fullname [::sm/word-string {:max 250}]]
|
||||||
|
@ -53,14 +53,12 @@
|
||||||
[:props {:optional true}
|
[:props {:optional true}
|
||||||
[:map-of {:title "ProfileProps"} :keyword :any]]])
|
[:map-of {:title "ProfileProps"} :keyword :any]]])
|
||||||
|
|
||||||
(def valid-profile?
|
|
||||||
(sm/pred-fn schema:profile))
|
|
||||||
|
|
||||||
;; --- QUERY: Get profile (own)
|
;; --- QUERY: Get profile (own)
|
||||||
|
|
||||||
(sv/defmethod ::get-profile
|
(sv/defmethod ::get-profile
|
||||||
{::rpc/auth false
|
{::rpc/auth false
|
||||||
::doc/added "1.18"
|
::doc/added "1.18"
|
||||||
|
::sm/params [:map]
|
||||||
::sm/result schema:profile}
|
::sm/result schema:profile}
|
||||||
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id]}]
|
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id]}]
|
||||||
;; We need to return the anonymous profile object in two cases, when
|
;; We need to return the anonymous profile object in two cases, when
|
||||||
|
@ -93,10 +91,6 @@
|
||||||
::sm/result schema:profile}
|
::sm/result schema:profile}
|
||||||
[{:keys [::db/pool] :as cfg} {:keys [::rpc/profile-id fullname lang theme] :as params}]
|
[{: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]
|
(db/with-atomic [conn pool]
|
||||||
;; NOTE: we need to retrieve the profile independently if we use
|
;; NOTE: we need to retrieve the profile independently if we use
|
||||||
;; it or not for explicit locking and avoid concurrent updates of
|
;; it or not for explicit locking and avoid concurrent updates of
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue