Create new auditions at the ned of the order

Closes #55
This commit is contained in:
Matt Young 2024-11-01 10:46:37 -05:00
parent 1628c3b071
commit 1613b0e590
1 changed files with 2 additions and 0 deletions

View File

@ -58,6 +58,7 @@ class AuditionController extends Controller
if (empty($alidData['scoring_guide_id'])) {
$validData['scoring_guide_id'] = 0;
}
$new_score_order = Audition::max('score_order') + 1;
// TODO Check if room 0 exists, create if not
Audition::create([
'event_id' => $validData['event_id'],
@ -70,6 +71,7 @@ class AuditionController extends Controller
'for_advancement' => $validData['for_advancement'],
'scoring_guide_id' => $validData['scoring_guide_id'],
'room_id' => 0,
'score_order' => $new_score_order,
]);
return to_route('admin.auditions.index')->with('success', 'Audition created successfully');