fix: ensure judgingentry always fetches data regardless of request method
This commit is contained in:
@@ -377,27 +377,25 @@ class PagesController extends Controller
|
|||||||
}
|
}
|
||||||
public function judgingentry(Request $judgingentry_req)
|
public function judgingentry(Request $judgingentry_req)
|
||||||
{
|
{
|
||||||
if (!$judgingentry_req->vehnum) {
|
|
||||||
$judges = \App\Models\Judges::all();
|
$judges = \App\Models\Judges::all();
|
||||||
$vehicles = \App\Models\Vehicles::all();
|
$vehicles = \App\Models\Vehicles::all();
|
||||||
return view('judgingentry', ['judges' => $judges, 'vehicles' => $vehicles]);
|
|
||||||
}
|
if ($judgingentry_req->isMethod('post')) {
|
||||||
$vehicle = $judgingentry_req->vehnum;
|
$vehicle = $judgingentry_req->vehnum;
|
||||||
$judge = $judgingentry_req->judgenum;
|
$judge = $judgingentry_req->judgenum;
|
||||||
$score = $judgingentry_req->vehscore;
|
$score = $judgingentry_req->vehscore;
|
||||||
$bidder_insert = VehicleScores::updateOrCreate(
|
|
||||||
[
|
VehicleScores::updateOrCreate(
|
||||||
'vehicle' => $vehicle,
|
['vehicle' => $vehicle, 'judge' => $judge],
|
||||||
'judge' => $judge
|
['overall_score' => $score]
|
||||||
],
|
|
||||||
[
|
|
||||||
'overall_score' => $score
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return redirect('judgingentry');
|
return redirect('judgingentry');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return view('judgingentry', ['judges' => $judges, 'vehicles' => $vehicles]);
|
||||||
|
}
|
||||||
|
|
||||||
public function showcars(Request $showcar_req)
|
public function showcars(Request $showcar_req)
|
||||||
{
|
{
|
||||||
if (!$showcar_req->bidderlname) {
|
if (!$showcar_req->bidderlname) {
|
||||||
|
|||||||
Reference in New Issue
Block a user