mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-31 15:24:31 +03:00
Users API: Fixed sending invite when using form requests
- Cast send_invite value in cases where it might not have been a boolean, which occurs on non-JSON requests. - Added test to cover. - Updated API docs to mention and shown boolean usage.
This commit is contained in:
@ -90,7 +90,7 @@ class UserApiController extends ApiController
|
||||
public function create(Request $request)
|
||||
{
|
||||
$data = $this->validate($request, $this->rules()['create']);
|
||||
$sendInvite = ($data['send_invite'] ?? false) === true;
|
||||
$sendInvite = boolval($data['send_invite'] ?? false) === true;
|
||||
|
||||
$user = null;
|
||||
DB::transaction(function () use ($data, $sendInvite, &$user) {
|
||||
|
Reference in New Issue
Block a user