Skip to content

Commit

Permalink
#2608 Hotfix to make user admin page filtering work again
Browse files Browse the repository at this point in the history
  • Loading branch information
Wotuu committed Nov 17, 2024
1 parent f467878 commit 90640b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Illuminate\Http\Request;
use Illuminate\Session\TokenMismatchException;
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Teapot\StatusCode;
Expand All @@ -28,6 +29,7 @@ class Handler extends ExceptionHandler
ModelNotFoundException::class,
TokenMismatchException::class,
ValidationException::class,
BadRequestException::class
];

/**
Expand Down
5 changes: 4 additions & 1 deletion app/Http/Controllers/Ajax/AjaxUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ public function get(Request $request)
{
$users = User::with(['patreonUserLink', 'roles', 'dungeonroutes'])->selectRaw('users.*');

$datatablesResult = (new UsersDatatablesHandler($request))->setBuilder($users)->applyRequestToBuilder()->getResult();
$datatablesResult = (new UsersDatatablesHandler($request))
->setBuilder($users)
->applyRequestToBuilder()
->getResult();

foreach ($datatablesResult['data'] as $user) {
/** @var $user User */
Expand Down
2 changes: 1 addition & 1 deletion app/Logic/Datatables/DatatablesHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

abstract class DatatablesHandler
{
const VALID_COLUMN_NAMES = ['title', 'public_key'];
const VALID_COLUMN_NAMES = ['title', 'public_key', 'name', 'email'];

protected Builder $builder;

Expand Down

0 comments on commit 90640b2

Please sign in to comment.