From 7bdd9b2a14ebda0a754ade6cecc94956778015f7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 25 Sep 2019 21:56:56 -0600 Subject: [PATCH] Add /api/v1/follow_requests/{id}/authorize endpoint --- app/Http/Controllers/Api/ApiV1Controller.php | 16 ++++++++++++++++ routes/web.php | 1 + 2 files changed, 17 insertions(+) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 62f6793a..966c5fca 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -768,6 +768,22 @@ class ApiV1Controller extends Controller return response()->json($res); } + /** + * POST /api/v1/follow_requests/{id}/authorize + * + * @param integer $id + * + * @return null + */ + public function accountFollowRequestAccept(Request $request, $id) + { + abort_if(!$request->user(), 403); + + // todo + + return response()->json([]); + } + public function statusById(Request $request, $id) { $status = Status::whereVisibility('public')->findOrFail($id); diff --git a/routes/web.php b/routes/web.php index 0b020f6e..08dc9c6c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -104,6 +104,7 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact Route::post('statuses/{id}/unfavourite', 'Api\ApiV1Controller@statusUnfavouriteById')->middleware('auth:api'); Route::get('filters', 'Api\ApiV1Controller@accountFilters')->middleware('auth:api'); Route::get('follow_requests', 'Api\ApiV1Controller@accountFollowRequests')->middleware('auth:api'); + Route::post('follow_requests/{id}/authorize', 'Api\ApiV1Controller@accountFollowRequestAccept')->middleware('auth:api'); Route::get('likes', 'ApiController@hydrateLikes'); Route::post('media', 'ApiController@uploadMedia')->middleware('auth:api');