Fix for user creation

This commit is contained in:
Deon George 2024-06-04 19:21:38 +10:00
parent 1753111f8f
commit efdb6b96ea

View File

@ -21,7 +21,7 @@ class UserRequest extends FormRequest
$o = $this->route('o');
return [
'email' => 'required|email|unique:users,email,'.($o->exists ? $o->id : 0),
'email' => 'required|email|unique:users,email,'.($o?->exists ? $o->id : 0),
'name' => 'required|min:3',
'pgp_pubkey' => [
'nullable',
@ -33,7 +33,7 @@ class UserRequest extends FormRequest
'admin' => 'required|boolean',
'system_id' => [
'nullable',
Rule::in($o->systems->pluck('id')),
Rule::in($o?->systems->pluck('id')),
],
];
}