fixed reading transactions and category deletion

This commit is contained in:
Finn 2018-01-16 14:47:17 +00:00
parent f79ec09782
commit 5ad83795bd
3 changed files with 3 additions and 1 deletions

View file

@ -84,6 +84,7 @@ sub delete {
my $id = $c->param('id');
if ( my $category = $c->result_set->find($id) ) {
$category->transaction_category->delete;
$category->delete;
$c->flash( success => 'Category Deleted' );
} else {

View file

@ -54,6 +54,7 @@ sub delete {
my $id = $c->param('id');
if ( my $transaction = $c->result_set->find($id) ) {
$transaction->category->delete;
$transaction->delete;
$c->flash( success => 'Successfully deleted transaction' );
$c->redirect_to( '/admin/transactions' );