Add support for node management actions using new services
This commit is contained in:
parent
4391defb9f
commit
c1a078bdcf
33 changed files with 1375 additions and 745 deletions
|
@ -74,15 +74,15 @@ class DeletionService
|
|||
*/
|
||||
public function handle($user)
|
||||
{
|
||||
if (! $user instanceof User) {
|
||||
$user = $this->repository->find($user);
|
||||
if ($user instanceof User) {
|
||||
$user = $user->id;
|
||||
}
|
||||
|
||||
$servers = $this->serverRepository->findWhere([['owner_id', '=', $user->id]]);
|
||||
$servers = $this->serverRepository->findWhere([['owner_id', '=', $user]]);
|
||||
if (count($servers) > 0) {
|
||||
throw new DisplayException($this->translator->trans('admin/user.exceptions.user_has_servers'));
|
||||
}
|
||||
|
||||
return $this->repository->delete($user->id);
|
||||
return $this->repository->delete($user);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue