From 26a30f5d1155e095e3e898e91d091482d8fed558 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 6 Mar 2024 22:19:03 +0100 Subject: [PATCH] feat: integration with VATSIM API Core v2 (rating times) Partially solves #808 --- app/Http/Controllers/TrainingController.php | 4 ++-- app/Http/Controllers/UserController.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/TrainingController.php b/app/Http/Controllers/TrainingController.php index 56beb006e..27909ba89 100644 --- a/app/Http/Controllers/TrainingController.php +++ b/app/Http/Controllers/TrainingController.php @@ -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) { diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 23cdf89bc..33c440b45 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -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); }