Skip to content

Commit

Permalink
VIP listing minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hobsRKM committed May 30, 2024
1 parent 2d0816b commit a3b0b65
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/Http/Controllers/VIP/VIPController.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ public function index(Request $request)
<button type="submit" class="btn btn-danger">Delete</button>
</form>';
}
$profileName = $response['response']['players'][0]['personaname'];
$serverName = $vip->sid ? $vip->server->serverIp . ':' . $vip->server->port : '';
if(!empty($response))
$profileName = $response['response']['players'][0]['personaname'];
else
$profileName = $vip->name;
$serverName = $vip->server->serverIp . ':' . $vip->server->port;

$formattedData[] = [
'id' => $vip->id,
Expand All @@ -92,7 +95,7 @@ public function index(Request $request)
return response()->json([
'draw' => intval($request->input('draw')),
'recordsTotal' => $totalVips,
'recordsFiltered' => count($formattedData),
"recordsFiltered" => !empty($searchValue) ? count($formattedData) : $totalVips ,
'data' => $formattedData
]);
} else {
Expand Down

0 comments on commit a3b0b65

Please sign in to comment.