Merge branch 'bugfix/Admin-EntryController-Fix-For-New-Scoring'
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
This commit is contained in:
commit
e0c3a26411
|
|
@ -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'));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue