Fix get-new-tickets empty list error

This commit is contained in:
Ivan Diaz 2018-11-29 00:31:00 -03:00
parent 60036873b0
commit 761c3e4792
1 changed files with 7 additions and 2 deletions

View File

@ -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) {