Skip to content

Commit

Permalink
feat: integration with VATSIM API Core v2 (rating times)
Browse files Browse the repository at this point in the history
Partially solves #808
  • Loading branch information
blt950 committed Mar 6, 2024
1 parent 51f858a commit 26a30f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/TrainingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ public function store(Request $request)
$vatsimStats = [];
$client = new \GuzzleHttp\Client();
if (App::environment('production')) {
$res = $client->request('GET', 'https://api.vatsim.net/api/ratings/' . \Auth::id() . '/rating_times/');
$res = $client->request('GET', 'https://api.vatsim.net/v2/members/' . \Auth::id() . '/stats');
} else {
$res = $client->request('GET', 'https://api.vatsim.net/api/ratings/819096/rating_times/');
$res = $client->request('GET', 'https://api.vatsim.net/v2/members/819096/stats');
}

if ($res->getStatusCode() == 200) {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public function fetchVatsimHours(Request $request)
$vatsimStats = [];
try {
$client = new \GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.vatsim.net/api/ratings/' . $cid . '/rating_times/');
$res = $client->request('GET', 'https://api.vatsim.net/v2/members/' . $cid . '/stats');
if ($res->getStatusCode() == 200) {
$vatsimStats = json_decode($res->getBody(), false);
}
Expand Down

0 comments on commit 26a30f5

Please sign in to comment.