Fix error in admin EntryController related to updates in scoring.

This commit is contained in:
Matt Young 2025-06-30 15:57:59 -05:00
parent 4faeb63c95
commit 3319438c0d
1 changed files with 3 additions and 4 deletions

View File

@ -4,7 +4,6 @@ namespace App\Http\Controllers\Admin;
use App\Actions\Entries\CreateEntry; use App\Actions\Entries\CreateEntry;
use App\Actions\Entries\UpdateEntry; use App\Actions\Entries\UpdateEntry;
use App\Actions\Tabulation\CalculateScoreSheetTotal;
use App\Exceptions\ManageEntryException; use App\Exceptions\ManageEntryException;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Audition; use App\Models\Audition;
@ -143,7 +142,7 @@ class EntryController extends Controller
return redirect(route('admin.entries.index'))->with('success', 'The entry has been added.'); return redirect(route('admin.entries.index'))->with('success', 'The entry has been added.');
} }
public function edit(Entry $entry, CalculateScoreSheetTotal $calculator, ScoreService $scoreService) public function edit(Entry $entry, ScoreService $scoreService)
{ {
if ($entry->audition->hasFlag('seats_published')) { if ($entry->audition->hasFlag('seats_published')) {
return to_route('admin.entries.index')->with('error', return to_route('admin.entries.index')->with('error',
@ -161,8 +160,8 @@ class EntryController extends Controller
foreach ($scores as $score) { foreach ($scores as $score) {
$score->entry = $entry; $score->entry = $entry;
$score->valid = $scoreService->isScoreSheetValid($score); $score->valid = $scoreService->isScoreSheetValid($score);
$score->seating_total_score = $calculator('seating', $entry, $score->judge)[0]; $score->seating_total_score = $score->seating_total ?? 0;
$score->advancement_total_score = $calculator('advancement', $entry, $score->judge)[0]; $score->advancement_total_score = $score->advancement_total ?? 0;
} }
return view('admin.entries.edit', compact('entry', 'students', 'auditions', 'scores')); return view('admin.entries.edit', compact('entry', 'students', 'auditions', 'scores'));