diff --git a/server/controllers/staff/get-new-tickets.php b/server/controllers/staff/get-new-tickets.php index 381ca2a3..8d2ed933 100755 --- a/server/controllers/staff/get-new-tickets.php +++ b/server/controllers/staff/get-new-tickets.php @@ -42,13 +42,18 @@ class GetNewTicketsStaffController extends Controller { ]; } public function handler() { + $page = Controller::request('page'); + if (Ticket::isTableEmpty()) { - Response::respondSuccess([]); + Response::respondSuccess([ + 'tickets' => [], + 'page' => $page, + 'pages' => 0 + ]); return; } $user = Controller::getLoggedUser(); - $page = Controller::request('page'); $query = ' ('; foreach ($user->sharedDepartmentList as $department) {