Skip to content

Commit

Permalink
Default to user facility if somehow it isn't set and doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonhasacat committed Aug 10, 2023
1 parent f6b520c commit cb41569
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/Http/Controllers/TrainingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,8 @@ function viewEvals(
if (Facility::find($trainingfac)) {
$trainingfacname = Helper::facShtLng($trainingfac);
} else {
var_dump($trainingfac);
exit;
abort(500);
$trainingfac = Auth::user()->facility;
$trainingfacname = Auth::user()->facility()->name;
}
}
$evals = $trainingfac ? Facility::find($trainingfac)->evaluations()->where('facility_id',
Expand Down

0 comments on commit cb41569

Please sign in to comment.