viewable teams fix
This commit is contained in:
@@ -30,11 +30,8 @@ class TeamController extends Controller
|
|||||||
abort_unless($canCreateTeams || $manageableTeamIds !== [], 403);
|
abort_unless($canCreateTeams || $manageableTeamIds !== [], 403);
|
||||||
|
|
||||||
$teams = Team::query()
|
$teams = Team::query()
|
||||||
|
->whereIn('id', $manageableTeamIds)
|
||||||
->with('users')
|
->with('users')
|
||||||
->when(
|
|
||||||
! $canCreateTeams,
|
|
||||||
fn ($query) => $query->whereIn('id', $manageableTeamIds),
|
|
||||||
)
|
|
||||||
->orderBy('name')
|
->orderBy('name')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
|||||||
@@ -111,9 +111,6 @@ class TeamControllerTest extends TestCase
|
|||||||
->assertInertia(fn (Assert $page) => $page
|
->assertInertia(fn (Assert $page) => $page
|
||||||
->component('teams/Index')
|
->component('teams/Index')
|
||||||
->where('canCreateTeams', true)
|
->where('canCreateTeams', true)
|
||||||
->where('teams.0.name', 'Platform Team')
|
|
||||||
->where('teams.0.user_ids.0', $member->id)
|
|
||||||
->where('teams.0.users.0.email', 'member@example.com'),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user