mirror of
https://github.com/penpot/penpot.git
synced 2025-02-09 00:28:20 -05:00
commit
c918e06859
3 changed files with 4 additions and 6 deletions
|
@ -53,8 +53,7 @@
|
||||||
(assoc (->> sk str/kebab (keyword "penpot")) v))))]
|
(assoc (->> sk str/kebab (keyword "penpot")) v))))]
|
||||||
(reduce-kv process-param {} params)))
|
(reduce-kv process-param {} params)))
|
||||||
|
|
||||||
(def ^:private
|
(def profile-props
|
||||||
profile-props
|
|
||||||
[:id
|
[:id
|
||||||
:is-active
|
:is-active
|
||||||
:is-muted
|
:is-muted
|
||||||
|
|
|
@ -110,7 +110,6 @@
|
||||||
::sm/params schema:update-profile
|
::sm/params schema:update-profile
|
||||||
::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}]
|
||||||
|
|
||||||
(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
|
||||||
|
|
|
@ -343,9 +343,9 @@
|
||||||
(watch [_ state _]
|
(watch [_ state _]
|
||||||
(let [on-success (:on-success opts identity)
|
(let [on-success (:on-success opts identity)
|
||||||
on-error (:on-error opts rx/throw)
|
on-error (:on-error opts rx/throw)
|
||||||
profile (:profile state)]
|
profile (:profile state)
|
||||||
|
params (select-keys profile [:fullname :lang :theme])]
|
||||||
(->> (rp/cmd! :update-profile (dissoc profile :props))
|
(->> (rp/cmd! :update-profile params)
|
||||||
(rx/tap on-success)
|
(rx/tap on-success)
|
||||||
(rx/catch on-error))))))
|
(rx/catch on-error))))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue