From 79d9d797373ef19d29270f5f1ce341f217090a20 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 23 Nov 2023 12:53:08 +0100 Subject: [PATCH] :fire: Remove unnecesary assert on get-profile rpc method --- backend/src/app/rpc/commands/profile.clj | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/backend/src/app/rpc/commands/profile.clj b/backend/src/app/rpc/commands/profile.clj index a5735d694..b038fd672 100644 --- a/backend/src/app/rpc/commands/profile.clj +++ b/backend/src/app/rpc/commands/profile.clj @@ -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