0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-03 04:49:03 -05:00

Improve error handlign on password change event.

This commit is contained in:
Andrey Antukh 2016-04-16 14:08:54 +03:00
parent 1282fd9641
commit 563d3e6dd3
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -63,6 +63,10 @@
(-apply-effect [_ state]
(udm/info! (tr "profile.password-saved"))))
(defn password-updated
[]
(PasswordUpdated.))
;; --- Update Password
(defrecord UpdatePassword [data]
@ -75,8 +79,9 @@
(let [params {:old-password (:old-password data)
:password (:password-1 data)}]
(->> (rp/req :update/password params)
(rx/catch rp/client-error? on-error)
(rx/map #(->PasswordUpdated)))))))
(rx/map password-updated)
(rx/catch rp/client-error? on-error))))))
(def ^:private update-password-schema
[[:password-1 sc/required sc/string [sc/min-len 6]]