mirror of
https://github.com/cydrobolt/polr.git
synced 2024-11-12 21:22:28 +01:00
Use ->user instead of directly invoking getApiUserInfo
This commit is contained in:
parent
cf549eb241
commit
e786fc2cc1
@ -9,14 +9,13 @@ use App\Exceptions\Api\ApiException;
|
|||||||
|
|
||||||
class ApiAnalyticsController extends ApiController {
|
class ApiAnalyticsController extends ApiController {
|
||||||
public function lookupLinkStats (Request $request, $stats_type=false) {
|
public function lookupLinkStats (Request $request, $stats_type=false) {
|
||||||
|
$user = $request->user;
|
||||||
$response_type = $request->input('response_type') ?: 'json';
|
$response_type = $request->input('response_type') ?: 'json';
|
||||||
|
|
||||||
if ($response_type != 'json') {
|
if ($response_type != 'json') {
|
||||||
throw new ApiException('JSON_ONLY', 'Only JSON-encoded data is available for this endpoint.', 401, $response_type);
|
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(), [
|
$validator = \Validator::make($request->all(), [
|
||||||
'url_ending' => 'required|alpha_dash',
|
'url_ending' => 'required|alpha_dash',
|
||||||
'stats_type' => 'alpha_num',
|
'stats_type' => 'alpha_num',
|
||||||
|
@ -41,9 +41,7 @@ class ApiLinkController extends ApiController {
|
|||||||
|
|
||||||
public function lookupLink(Request $request) {
|
public function lookupLink(Request $request) {
|
||||||
$user = $request->user;
|
$user = $request->user;
|
||||||
|
|
||||||
$response_type = $request->input('response_type');
|
$response_type = $request->input('response_type');
|
||||||
// $user = self::getApiUserInfo($request);
|
|
||||||
|
|
||||||
// Validate URL form data
|
// Validate URL form data
|
||||||
$validator = \Validator::make($request->all(), [
|
$validator = \Validator::make($request->all(), [
|
||||||
|
Loading…
Reference in New Issue
Block a user