you can't add an existing invoice.

This commit is contained in:
Bryce Covert
2018-07-30 09:23:56 -07:00
parent 5cac08437f
commit 9e00372857
5 changed files with 36 additions and 5 deletions

View File

@@ -259,7 +259,8 @@
:location
[:expense_account [:id :name [:parent [:id :name]]]]]]
]]}]}
:on-success [::invoice-created]}})))
:on-success [::invoice-created]
:on-error [::invoice-create-failed]}})))
(re-frame/reg-event-fx
::edit-invoice-save
@@ -331,6 +332,11 @@
invoices)))
(dissoc ::handwrite-checks))})))
(re-frame/reg-event-fx
::invoice-create-failed
(fn [{:keys [db]} [_ data]]
{:dispatch [::events/modal-failed ::new-invoice "That invoice already exists."]}))
(re-frame/reg-event-fx
::invoice-created
(fn [{:keys [db]} [_ {:keys [add-invoice]}]]