Merge branch 'main' into develop

This commit is contained in:
Andrey Antukh 2021-03-08 11:58:48 +01:00
commit fdeaac7f65
11 changed files with 183 additions and 123 deletions

View file

@ -49,8 +49,10 @@
(declare register-profile)
(s/def ::invitation-token ::us/not-empty-string)
(s/def ::terms-privacy ::us/boolean)
(s/def ::register-profile
(s/keys :req-un [::email ::password ::fullname]
(s/keys :req-un [::email ::password ::fullname ::terms-privacy]
:opt-un [::invitation-token]))
(sv/defmethod ::register-profile {:auth false :rlimit :password}
@ -63,6 +65,10 @@
(ex/raise :type :validation
:code :email-domain-is-not-allowed))
(when-not (:terms-privacy params)
(ex/raise :type :validation
:code :invalid-terms-and-privacy))
(db/with-atomic [conn pool]
(let [cfg (assoc cfg :conn conn)]
(register-profile cfg params))))
@ -331,7 +337,8 @@
{:id id}))
(s/def ::update-profile
(s/keys :req-un [::id ::fullname ::lang ::theme]))
(s/keys :req-un [::id ::fullname]
:opt-un [::lang ::theme]))
(sv/defmethod ::update-profile
[{:keys [pool] :as cfg} params]