1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-11-09 19:52:28 +01:00

Use ->user instead of directly invoking getApiUserInfo

This commit is contained in:
Chaoyi Zha 2017-03-20 17:11:38 -04:00
parent cf549eb241
commit e786fc2cc1
2 changed files with 1 additions and 4 deletions

View File

@ -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',

View File

@ -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(), [