checking for existing invoices.

This commit is contained in:
Bryce Covert
2018-07-30 17:49:05 -07:00
parent 9e00372857
commit 83ba0e4db0
3 changed files with 16 additions and 3 deletions

View File

@@ -279,7 +279,8 @@
[:expense_accounts [:amount :id :expense_account_id
:location
[:expense_account [:id :name [:parent [:id :name]]]]]]]]}]}
:on-success [::invoice-edited]}})))
:on-success [::invoice-edited]
:on-error [::invoice-edit-failed]}})))
(re-frame/reg-event-fx
@@ -361,6 +362,12 @@
i)) is)))
(dissoc ::edit-invoice))}))
(re-frame/reg-event-fx
::invoice-edit-failed
(fn [{:keys [db]} [_ data]]
{:dispatch [::events/modal-failed ::edit-invoice "That invoice already exists."]}))
(re-frame/reg-event-fx
::invoice-voided
(fn [{:keys [db]} [_ {:keys [void-invoice]}]]