Refactor account deletion condition in ProfileController
This commit is contained in:
parent
726831c511
commit
c7309627ab
1 changed files with 2 additions and 2 deletions
|
|
@ -126,8 +126,8 @@ public function destroy(ProfileDeleteRequest $request): RedirectResponse
|
|||
|
||||
$user->workspaces()->detach();
|
||||
|
||||
if ($account) {
|
||||
$account->delete();
|
||||
if ($account && $user->isAccountOwner()) {
|
||||
$account->delete();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue