Changes auto-committed by Conductor

This commit is contained in:
Andras Bacsai
2025-10-16 17:13:45 +02:00
parent 1906278101
commit 975d1b8a6b
5 changed files with 790 additions and 115 deletions

View File

@@ -23,13 +23,13 @@ class DeleteUserServers
$servers = collect();
// Get all teams the user belongs to
$teams = $this->user->teams;
$teams = $this->user->teams()->get();
foreach ($teams as $team) {
// Only include servers from teams where user is owner or admin
$userRole = $team->pivot->role;
if ($userRole === 'owner' || $userRole === 'admin') {
$teamServers = $team->servers;
$teamServers = $team->servers()->get();
$servers = $servers->merge($teamServers);
}
}