From e786fc2cc1054bea7eca0b58e2c47dc3bbdd5b54 Mon Sep 17 00:00:00 2001 From: Chaoyi Zha Date: Mon, 20 Mar 2017 17:11:38 -0400 Subject: [PATCH] Use ->user instead of directly invoking getApiUserInfo --- app/Http/Controllers/Api/ApiAnalyticsController.php | 3 +-- app/Http/Controllers/Api/ApiLinkController.php | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/Http/Controllers/Api/ApiAnalyticsController.php b/app/Http/Controllers/Api/ApiAnalyticsController.php index abb2d86..3908307 100644 --- a/app/Http/Controllers/Api/ApiAnalyticsController.php +++ b/app/Http/Controllers/Api/ApiAnalyticsController.php @@ -9,14 +9,13 @@ use App\Exceptions\Api\ApiException; class ApiAnalyticsController extends ApiController { public function lookupLinkStats (Request $request, $stats_type=false) { + $user = $request->user; $response_type = $request->input('response_type') ?: 'json'; if ($response_type != 'json') { throw new ApiException('JSON_ONLY', 'Only JSON-encoded data is available for this endpoint.', 401, $response_type); } - $user = self::getApiUserInfo($request); - $validator = \Validator::make($request->all(), [ 'url_ending' => 'required|alpha_dash', 'stats_type' => 'alpha_num', diff --git a/app/Http/Controllers/Api/ApiLinkController.php b/app/Http/Controllers/Api/ApiLinkController.php index b41202c..e05c25e 100644 --- a/app/Http/Controllers/Api/ApiLinkController.php +++ b/app/Http/Controllers/Api/ApiLinkController.php @@ -41,9 +41,7 @@ class ApiLinkController extends ApiController { public function lookupLink(Request $request) { $user = $request->user; - $response_type = $request->input('response_type'); - // $user = self::getApiUserInfo($request); // Validate URL form data $validator = \Validator::make($request->all(), [