Cleaned up
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace routes;
|
||||
|
||||
use classes\authentication;
|
||||
use classes\response;
|
||||
use objects\bookings_o;
|
||||
use objects\logs_o;
|
||||
use traits\route_t;
|
||||
@@ -16,7 +17,8 @@ class bookingsRoute
|
||||
/** All bookings */
|
||||
$this->get('/bookings', function () {
|
||||
// Require the user to be logged in
|
||||
global $response;
|
||||
global /** @var response $response */
|
||||
$response;
|
||||
$this->requirePermission('list_bookings');
|
||||
// Get the user object
|
||||
$user = (new authentication())->get_user();
|
||||
@@ -24,7 +26,7 @@ class bookingsRoute
|
||||
if ($user) {
|
||||
// Log the incident
|
||||
(new logs_o())->add('bookings', 'global', 1, $user->id, 'LIST_BOOKINGS', 'Successfully listed bookings');
|
||||
// Return the list of departments
|
||||
// Return the list of bookings
|
||||
$response->success(
|
||||
(new bookings_o())->listObjectsWithPaginationIfSet()
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user