Skip to content

Commit

Permalink
fix: add error notification for $invalid form
Browse files Browse the repository at this point in the history
This commit adds a Notify.danger() call to alert the user that an error
occurred in their form.
  • Loading branch information
jniles committed May 30, 2016
1 parent c6fd67b commit 364f3f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/js/services/VoucherService.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function VoucherService(PrototypeApiService) {
// bind the voucher items
clean.items = items;

return PrototypeApiService.call(service, { voucher : clean });
return PrototypeApiService.create.call(service, { voucher : clean });
}

return service;
Expand Down
2 changes: 2 additions & 0 deletions client/src/partials/vouchers/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ function SimpleJournalVoucherController(AppCache, Vouchers, Accounts, Session, u
}

function submit(form) {

// stop submission if the form is invalid
if (form.$invalid) {
Notify.danger('FORM.ERRORS.RECORD_ERROR');
return;
}

Expand Down

0 comments on commit 364f3f9

Please sign in to comment.