Commit 1380ec26 authored by Jacob Priddy's avatar Jacob Priddy 👌

Fix notes requiring something on admin page, order users by id

parent a058d82f
Pipeline #13238 passed with stages
in 9 minutes and 8 seconds
......@@ -98,8 +98,8 @@ class DoorsController extends Controller
$this->validate($this->request, [
'location' => 'required|string|max:255',
'name' => 'required|string|max:255',
'public' => 'boolean',
'notes' => 'string|max:255',
'public' => 'required|boolean',
'notes' => 'nullable|string|max:255',
]);
$presenter = new UpdateDoorPresenter();
......
......@@ -38,7 +38,6 @@
<label for="notes">
Administrative Notes
</label>
<span class="text-muted float-right">required</span>
<textarea name="notes" class="form-control" id="notes" placeholder="Anything useful can go here.">{{ old('notes') }}</textarea>
<small id="notesHelp" class="form-text text-muted">
This is a place only for administrative notes that only administrators can see.
......
......@@ -57,10 +57,11 @@ class DatabaseUsersRepository implements UsersRepository
*/
public function search(?string $query = null): array
{
$builder = \App\User::query()->orderBy('id');
if (!$query) {
$users = \App\User::all()->values()->all();
$users = $builder->get()->values()->all();
} else {
$users = \App\User::query()
$users = $builder
->where('first_name', 'ILIKE', "%$query%")
->orWhere('id', '=', self::castToInt($query))
->orWhere('last_name', 'ILIKE', "%$query%")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment