fixed reading transactions and category deletion
This commit is contained in:
parent
f79ec09782
commit
5ad83795bd
3 changed files with 3 additions and 1 deletions
|
@ -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 {
|
||||
|
|
|
@ -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' );
|
||||
|
|
Reference in a new issue