0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-22 07:40:58 +00:00

Revised webhooks list to new format

Also aligned query naming to start with model in use.
Also added created/updated sort options to roles.
This commit is contained in:
Dan Brown 2022-10-30 12:02:06 +00:00
parent 98b59a1024
commit f75091a1c5
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
12 changed files with 123 additions and 40 deletions
app/Http/Controllers

View file

@ -3,6 +3,7 @@
namespace BookStack\Http\Controllers;
use BookStack\Actions\ActivityType;
use BookStack\Actions\Queries\WebhooksAllPaginatedAndSorted;
use BookStack\Actions\Webhook;
use Illuminate\Http\Request;
@ -18,16 +19,23 @@ class WebhookController extends Controller
/**
* Show all webhooks configured in the system.
*/
public function index()
public function index(Request $request)
{
$webhooks = Webhook::query()
->orderBy('name', 'desc')
->with('trackedEvents')
->get();
$listDetails = [
'search' => $request->get('search', ''),
'sort' => setting()->getForCurrentUser('webhooks_sort', 'name'),
'order' => setting()->getForCurrentUser('webhooks_sort_order', 'asc'),
];
$webhooks = (new WebhooksAllPaginatedAndSorted())->run(20, $listDetails);
$webhooks->appends(['search' => $listDetails['search']]);
$this->setPageTitle(trans('settings.webhooks'));
return view('settings.webhooks.index', ['webhooks' => $webhooks]);
return view('settings.webhooks.index', [
'webhooks' => $webhooks,
'listDetails' => $listDetails,
]);
}
/**