1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

API: Updated docs with consistent types, fixed users response example

For #5178 and #5183
This commit is contained in:
Dan Brown
2024-08-27 12:23:36 +01:00
parent 9f68ca5358
commit 1f2506221a
3 changed files with 11 additions and 12 deletions

View File

@ -37,27 +37,28 @@ class UserApiController extends ApiController
{
return [
'create' => [
'name' => ['required', 'min:2', 'max:100'],
'name' => ['required', 'string', 'min:2', 'max:100'],
'email' => [
'required', 'min:2', 'email', new Unique('users', 'email'),
'required', 'string', 'email', 'min:2', new Unique('users', 'email'),
],
'external_auth_id' => ['string'],
'language' => ['string', 'max:15', 'alpha_dash'],
'password' => [Password::default()],
'password' => ['string', Password::default()],
'roles' => ['array'],
'roles.*' => ['integer'],
'send_invite' => ['boolean'],
],
'update' => [
'name' => ['min:2', 'max:100'],
'name' => ['string', 'min:2', 'max:100'],
'email' => [
'min:2',
'string',
'email',
'min:2',
(new Unique('users', 'email'))->ignore($userId ?? null),
],
'external_auth_id' => ['string'],
'language' => ['string', 'max:15', 'alpha_dash'],
'password' => [Password::default()],
'password' => ['string', Password::default()],
'roles' => ['array'],
'roles.*' => ['integer'],
],