0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 17:00:36 -05:00

Add profile-updated event with proper success notification.

This commit is contained in:
Andrey Antukh 2016-05-06 22:19:20 +03:00
parent 25bcf8f139
commit 7f865db89c
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -39,6 +39,21 @@
[]
(FetchProfile.))
;; --- Profile Updated
(defrecord ProfileUpdated [data]
rs/WatchEvent
(-apply-watch [_ state s]
(rx/of (profile-fetched data)))
rs/EffectEvent
(-apply-effect [_ state]
(udm/info! (tr "settings.profile-saved"))))
(defn profile-updated
[data]
(ProfileUpdated. data))
;; --- Update Profile
(defrecord UpdateProfile [data]
@ -50,7 +65,7 @@
(rx/of)))]
(->> (rp/req :update/profile data)
(rx/map :payload)
(rx/map profile-fetched)
(rx/map profile-updated)
(rx/catch rp/client-error? on-error)))))
(def update-profile-schema