Skip to content

Commit 6ec992d

Browse files
authored
fix: address feedback
1 parent 0729058 commit 6ec992d

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

app/Platform/Controllers/TicketController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use App\Http\Controller;
99
use App\Models\Achievement;
1010
use App\Models\Game;
11+
use App\Models\System;
1112
use App\Models\Ticket;
1213
use App\Models\User;
1314
use App\Platform\Actions\BuildTicketCreationDataAction;
@@ -38,6 +39,8 @@ public function index(TicketListRequest $request): InertiaResponse
3839

3940
public function forGame(TicketListRequest $request, Game $game): InertiaResponse
4041
{
42+
abort_if(in_array($game->system_id, [System::Hubs, System::Events], true), 404);
43+
4144
return $this->renderTicketList($request, 'game/[game]/tickets', $game);
4245
}
4346

tests/Feature/Platform/Controllers/TicketControllerIndexTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,21 @@ function createTicketListPageTickets(int $ticketCount): array
9494
);
9595
});
9696

97+
it('given a hub or event game, the game route returns a 404', function (int $systemId) {
98+
// ARRANGE
99+
$game = Game::factory()->create(['system_id' => $systemId]);
100+
actingAs(User::factory()->create());
101+
102+
// ACT
103+
$response = get(route('game.tickets2', ['game' => $game->id]));
104+
105+
// ASSERT
106+
$response->assertNotFound();
107+
})->with([
108+
'hub' => System::Hubs,
109+
'event' => System::Events,
110+
]);
111+
97112
it('uses persisted display preferences for the initial ticket list', function () {
98113
// ARRANGE
99114
$tickets = createTicketListPageTickets(2);

0 commit comments

Comments
 (0)