Allow 0 minutes before/after schedule, fix room sorting

This commit is contained in:
Igor Scheller 2020-12-26 02:35:49 +01:00
parent 53d5f8518b
commit d7152ebc09
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ function Room_validate_name(string $name, int $room_id)
*/ */
function Rooms() function Rooms()
{ {
return Room::all()->sortBy('name'); return Room::orderBy('name')->get();
} }
/** /**

View File

@ -130,8 +130,8 @@ class ImportSchedule extends BaseController
'name' => 'required', 'name' => 'required',
'url' => 'required', 'url' => 'required',
'shift_type' => 'required|int', 'shift_type' => 'required|int',
'minutes_before' => 'required|int', 'minutes_before' => 'int',
'minutes_after' => 'required|int', 'minutes_after' => 'int',
]); ]);
if (!isset($this->getShiftTypes()[$data['shift_type']])) { if (!isset($this->getShiftTypes()[$data['shift_type']])) {