Fix bug where some audition settings were not saved

Closes #47
This commit is contained in:
Matt Young 2024-07-27 10:18:26 -05:00
parent 38bb36df01
commit f0b2ec8f68
1 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
use App\Settings;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use function to_route;
class AuditionSettings extends Controller
@ -26,6 +27,10 @@ class AuditionSettings extends Controller
'fee_structure' => ['required', 'in:oneFeePerEntry,oneFeePerStudent'], // Options should align with the boot method of InvoiceDataServiceProvider
'late_fee' => ['nullable', 'numeric', 'min:0'],
'school_fee' => ['nullable', 'numeric', 'min:0'],
'payment_address' => ['required'],
'payment_city' => ['required'],
'payment_state' => ['required', 'max:2'],
'payment_zip' => ['required', 'min:5'],
]);
// Olympic Scoring Switch
@ -42,6 +47,7 @@ class AuditionSettings extends Controller
Settings::set($key, $value);
}
Cache::flush();
return to_route('audition-settings')->with('success', 'Settings Saved');
}
}