Skip to content

Commit

Permalink
🔥 remove deprecated approveFollowRequest endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu committed Jan 1, 2025
1 parent a86063f commit 04b35ea
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
15 changes: 0 additions & 15 deletions app/Http/Controllers/API/v1/FollowController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
3 changes: 0 additions & 3 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit 04b35ea

Please sign in to comment.