X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FHttp%2FControllers%2FTournamentController.php;h=9b21736d8ea4a111eece00198e6cd858ca856773;hb=212561cf1c6724b52c490104f5a2b4c3418b1c62;hp=e2fbe941a31b6b2b705b1e35c69724e495351191;hpb=f446d5bcf3b87bd9443a060e27e9c0601c96fbb9;p=alttp.git diff --git a/app/Http/Controllers/TournamentController.php b/app/Http/Controllers/TournamentController.php index e2fbe94..9b21736 100644 --- a/app/Http/Controllers/TournamentController.php +++ b/app/Http/Controllers/TournamentController.php @@ -30,6 +30,7 @@ class TournamentController extends Controller 'applications.user', 'rounds', 'rounds.results', + 'rounds.results.user', 'participants', 'participants.user', )->findOrFail($id); @@ -63,8 +64,12 @@ class TournamentController extends Controller public function discordSettings(Request $request, Tournament $tournament) { $this->authorize('update', $tournament); $validatedData = $request->validate([ + 'round_category' => 'string|nullable', 'round_template' => 'string|nullable', ]); + if (array_key_exists('round_category', $validatedData)) { + $tournament->discord_round_category = $validatedData['round_category']; + } if (array_key_exists('round_template', $validatedData)) { $tournament->discord_round_template = $validatedData['round_template']; } @@ -81,7 +86,7 @@ class TournamentController extends Controller $tournament->accept_applications = true; $tournament->save(); TournamentChanged::dispatch($tournament); - Protocol::tournamentOpenen($tournament, $request->user()); + Protocol::tournamentOpened($tournament, $request->user()); return $tournament->toJson(); }