Fix bad merge

This commit is contained in:
janherich 2018-05-02 10:06:22 +02:00
parent e830183011
commit 2c7063f96e
No known key found for this signature in database
GPG Key ID: C23B473AFBE94D13
1 changed files with 3 additions and 3 deletions

View File

@ -9,10 +9,10 @@
Optionally, one can specify event to be dispatched after fields are persisted."
([new-account-fields cofx]
(account-update new-account-fields nil cofx))
([new-account-fields after-update-event {{:accounts/keys [accounts current-account-id] :as db} :db :as cofx}]
(let [current-account (get accounts current-account-id)
([new-account-fields after-update-event {:keys [db] :as cofx}]
(let [current-account (:account/account db)
new-account (merge current-account new-account-fields)
fx {:db (assoc-in db [:accounts/accounts current-account-id] new-account)
fx {:db (assoc db :account/account new-account)
:data-store/save-account (assoc new-account :after-update-event after-update-event)}
{:keys [name photo-path]} new-account]
(if (or (:name new-account-fields) (:photo-path new-account-fields))