Skip to content

Commit

Permalink
detach company/dashboard after deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Mar 29, 2021
1 parent 5f8295f commit 9a82779
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Jobs/Common/DeleteCompany.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public function handle()
'recurring', 'reports', 'settings', 'taxes', 'transactions', 'transfers', 'widgets',
]);

$this->company->users()->detach();

$this->company->delete();
});

Expand Down
2 changes: 2 additions & 0 deletions app/Jobs/Common/DeleteDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public function handle()
\DB::transaction(function () {
$this->deleteRelationships($this->dashboard, ['widgets']);

$this->dashboard->users()->detach();

$this->dashboard->delete();
});

Expand Down

0 comments on commit 9a82779

Please sign in to comment.