mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Extend /users API endpoint
* add /users/{id} to get a single user * add variable to print fields that are otherwise hidden (e.g. email)
This commit is contained in:
@ -9,14 +9,15 @@ abstract class ApiController extends Controller
|
||||
{
|
||||
|
||||
protected $rules = [];
|
||||
protected $printHidden = [];
|
||||
|
||||
/**
|
||||
* Provide a paginated listing JSON response in a standard format
|
||||
* taking into account any pagination parameters passed by the user.
|
||||
*/
|
||||
protected function apiListingResponse(Builder $query, array $fields): JsonResponse
|
||||
protected function apiListingResponse(Builder $query, array $fields, array $protectedFieldsToPrint = []): JsonResponse
|
||||
{
|
||||
$listing = new ListingResponseBuilder($query, request(), $fields);
|
||||
$listing = new ListingResponseBuilder($query, request(), $fields, $protectedFieldsToPrint);
|
||||
return $listing->toResponse();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user