mirror of
https://github.com/penpot/penpot.git
synced 2025-02-09 08:38:15 -05:00
Improve error handlign on password change event.
This commit is contained in:
parent
1282fd9641
commit
563d3e6dd3
1 changed files with 7 additions and 2 deletions
|
@ -63,6 +63,10 @@
|
||||||
(-apply-effect [_ state]
|
(-apply-effect [_ state]
|
||||||
(udm/info! (tr "profile.password-saved"))))
|
(udm/info! (tr "profile.password-saved"))))
|
||||||
|
|
||||||
|
(defn password-updated
|
||||||
|
[]
|
||||||
|
(PasswordUpdated.))
|
||||||
|
|
||||||
;; --- Update Password
|
;; --- Update Password
|
||||||
|
|
||||||
(defrecord UpdatePassword [data]
|
(defrecord UpdatePassword [data]
|
||||||
|
@ -75,8 +79,9 @@
|
||||||
(let [params {:old-password (:old-password data)
|
(let [params {:old-password (:old-password data)
|
||||||
:password (:password-1 data)}]
|
:password (:password-1 data)}]
|
||||||
(->> (rp/req :update/password params)
|
(->> (rp/req :update/password params)
|
||||||
(rx/catch rp/client-error? on-error)
|
(rx/map password-updated)
|
||||||
(rx/map #(->PasswordUpdated)))))))
|
(rx/catch rp/client-error? on-error))))))
|
||||||
|
|
||||||
|
|
||||||
(def ^:private update-password-schema
|
(def ^:private update-password-schema
|
||||||
[[:password-1 sc/required sc/string [sc/min-len 6]]
|
[[:password-1 sc/required sc/string [sc/min-len 6]]
|
||||||
|
|
Loading…
Add table
Reference in a new issue