|
@@ -53,13 +53,13 @@ class User extends Controller
|
|
|
public function index(): JsonResponse
|
|
public function index(): JsonResponse
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
- request()->validate([
|
|
|
|
|
- 'game_id' => ['nullable', 'string', 'min:1'],
|
|
|
|
|
|
|
+ $search = request()->validate([
|
|
|
|
|
+ 'page' => ['nullable', 'integer', 'min:1'],
|
|
|
|
|
+ 'limit' => ['nullable', 'integer', 'min:1'],
|
|
|
'member_id' => ['nullable', 'string', 'min:1'],
|
|
'member_id' => ['nullable', 'string', 'min:1'],
|
|
|
'first_name' => ['nullable', 'string', 'min:1'],
|
|
'first_name' => ['nullable', 'string', 'min:1'],
|
|
|
'username' => ['nullable', 'string', 'min:1'],
|
|
'username' => ['nullable', 'string', 'min:1'],
|
|
|
]);
|
|
]);
|
|
|
- $search = request()->all();
|
|
|
|
|
$result = UserService::paginate($search);
|
|
$result = UserService::paginate($search);
|
|
|
} catch (ValidationException $e) {
|
|
} catch (ValidationException $e) {
|
|
|
return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|