mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-20 06:59:38 +00: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:
parent
4896c4047f
commit
56d07f1909
3 changed files with 27 additions and 2 deletions
app/Users/Controllers
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue