diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 35cd204c2..3914024e8 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -816,15 +816,13 @@ class ApiV1Controller extends Controller return response()->json([]); } - public function statusById(Request $request, $id) - { - $status = Status::whereVisibility('public')->findOrFail($id); - $resource = new Fractal\Resource\Item($status, new StatusTransformer()); - $res = $this->fractal->createData($resource)->toArray(); - - return response()->json($res); - } - + /** + * GET /api/v1/instance + * + * Information about the server. + * + * @return Instance + */ public function instance(Request $request) { $res = [ @@ -847,6 +845,29 @@ class ApiV1Controller extends Controller return response()->json($res, 200, [], JSON_PRETTY_PRINT); } + /** + * GET /api/v1/lists + * + * Return empty array as we don't support lists + * + * @return null + */ + public function accountLists(Request $request) + { + abort_if(!$request->user(), 403); + + return response()->json([]); + } + + public function statusById(Request $request, $id) + { + $status = Status::whereVisibility('public')->findOrFail($id); + $resource = new Fractal\Resource\Item($status, new StatusTransformer()); + $res = $this->fractal->createData($resource)->toArray(); + + return response()->json($res); + } + public function context(Request $request) { // todo diff --git a/routes/web.php b/routes/web.php index 654d7280d..9eb5c7ba2 100644 --- a/routes/web.php +++ b/routes/web.php @@ -107,6 +107,7 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact Route::post('follow_requests/{id}/authorize', 'Api\ApiV1Controller@accountFollowRequestAccept')->middleware('auth:api'); Route::post('follow_requests/{id}/reject', 'Api\ApiV1Controller@accountFollowRequestReject')->middleware('auth:api'); Route::get('suggestions', 'Api\ApiV1Controller@accountSuggestions')->middleware('auth:api'); + Route::get('lists', 'Api\ApiV1Controller@accountLists')->middleware('auth:api'); Route::get('likes', 'ApiController@hydrateLikes'); Route::post('media', 'ApiController@uploadMedia')->middleware('auth:api');