From 04b35ea4022f52c52e91a483b447c06cbbe55dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20St=C3=B6ckel?= Date: Wed, 1 Jan 2025 11:41:53 +0100 Subject: [PATCH] :fire: remove deprecated `approveFollowRequest` endpoint --- app/Http/Controllers/API/v1/FollowController.php | 15 --------------- routes/api.php | 3 --- 2 files changed, 18 deletions(-) diff --git a/app/Http/Controllers/API/v1/FollowController.php b/app/Http/Controllers/API/v1/FollowController.php index 8afb5f3e9..936f93f79 100644 --- a/app/Http/Controllers/API/v1/FollowController.php +++ b/app/Http/Controllers/API/v1/FollowController.php @@ -306,21 +306,6 @@ public function approveFollowRequestByUserId(int $userId): JsonResponse { } } - // TODO remove after 2024-10 - public function approveFollowRequest(Request $request): JsonResponse { - $validated = $request->validate(['userId' => ['required',]]); - - try { - FollowBackend::approveFollower(auth()->user()->id, $validated['userId']); - return $this->sendResponse(); - } catch (ModelNotFoundException) { - return $this->sendError('Request not found'); - } catch (Exception) { - Log::error('APIv1/approveFollowRequest: Could not approve follow request', ['user' => auth()->user(), 'userId' => $validated['userId']]); - return $this->sendError('Unknown error', 500); - } - } - /** * @param Request $request * diff --git a/routes/api.php b/routes/api.php index 889172039..7dfd078e4 100644 --- a/routes/api.php +++ b/routes/api.php @@ -112,9 +112,6 @@ Route::post('/{userId}/follow', [FollowController::class, 'createFollow']); Route::delete('/{userId}/follow', [FollowController::class, 'destroyFollow']); }); - Route::group(['middleware' => ['scope:write-followers']], static function() { - Route::put('approveFollowRequest', [FollowController::class, 'approveFollowRequest']); // TODO remove after 2024-10 - }); Route::group(['middleware' => ['scope:write-blocks']], static function() { Route::post('/{userId}/block', [UserController::class, 'createBlock']); Route::delete('/{userId}/block', [UserController::class, 'destroyBlock']);