Fix error with days input missing from flight create/edit

This commit is contained in:
Nabeel Shahzad 2018-03-30 18:25:27 -05:00
parent 1cbfdbdac5
commit 2c726f6c52

View File

@ -185,7 +185,10 @@ class FlightController extends Controller
return redirect()->back()->withInput($request->all());
}
$input['days'] = Days::getDaysMask($input['days']);
if (array_key_exists('days', $input) && filled($input['days'])) {
$input['days'] = Days::getDaysMask($input['days']);
}
$input['active'] = get_truth_state($input['active']);
$time = new Time($input['minutes'], $input['hours']);
@ -287,7 +290,9 @@ class FlightController extends Controller
return redirect()->back()->withInput($request->all());
}
$input['days'] = Days::getDaysMask($input['days']);
if (array_key_exists('days', $input) && filled($input['days'])) {
$input['days'] = Days::getDaysMask($input['days']);
}
$input['flight_time'] = Time::init(
$input['minutes'],