mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-20 15:23:44 +02:00
Code cleanup to use new findCountWhere function
This commit is contained in:
@@ -78,8 +78,8 @@ class DeletionService
|
||||
$user = $user->id;
|
||||
}
|
||||
|
||||
$servers = $this->serverRepository->findWhere([['owner_id', '=', $user]]);
|
||||
if (count($servers) > 0) {
|
||||
$servers = $this->serverRepository->withColumns('id')->findCountWhere([['owner_id', '=', $user]]);
|
||||
if ($servers > 0) {
|
||||
throw new DisplayException($this->translator->trans('admin/user.exceptions.user_has_servers'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user