mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 04:53:17 +00:00
Remove deprecated api routes
This commit is contained in:
parent
6c4deaba90
commit
1f4f8252f2
2 changed files with 0 additions and 64 deletions
|
@ -811,68 +811,6 @@ class PublicApiController extends Controller
|
|||
return response()->json($res);
|
||||
}
|
||||
|
||||
public function accountFollowers(Request $request, $id)
|
||||
{
|
||||
abort_if(!$request->user(), 403);
|
||||
$account = AccountService::get($id, true);
|
||||
abort_if(!$account, 404);
|
||||
$pid = $request->user()->profile_id;
|
||||
|
||||
if($pid != $account['id']) {
|
||||
if($account['locked']) {
|
||||
if(!FollowerService::follows($pid, $account['id'])) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
if(AccountService::hiddenFollowers($id)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if($request->has('page') && $request->page >= 10) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
$res = collect(FollowerService::followersPaginate($account['id'], $request->input('page', 1)))
|
||||
->map(fn($id) => AccountService::get($id, true))
|
||||
->filter()
|
||||
->values();
|
||||
|
||||
return response()->json($res);
|
||||
}
|
||||
|
||||
public function accountFollowing(Request $request, $id)
|
||||
{
|
||||
abort_if(!$request->user(), 403);
|
||||
$account = AccountService::get($id, true);
|
||||
abort_if(!$account, 404);
|
||||
$pid = $request->user()->profile_id;
|
||||
|
||||
if($pid != $account['id']) {
|
||||
if($account['locked']) {
|
||||
if(!FollowerService::follows($pid, $account['id'])) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
if(AccountService::hiddenFollowing($id)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if($request->has('page') && $request->page >= 10) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
$res = collect(FollowerService::followingPaginate($account['id'], $request->input('page', 1)))
|
||||
->map(fn($id) => AccountService::get($id, true))
|
||||
->filter()
|
||||
->values();
|
||||
|
||||
return response()->json($res);
|
||||
}
|
||||
|
||||
public function accountStatuses(Request $request, $id)
|
||||
{
|
||||
$this->validate($request, [
|
||||
|
|
|
@ -207,8 +207,6 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact
|
|||
Route::get('accounts/relationships', 'Api\ApiV1Controller@accountRelationshipsById');
|
||||
Route::get('accounts/search', 'Api\ApiV1Controller@accountSearch');
|
||||
Route::get('accounts/{id}/statuses', 'PublicApiController@accountStatuses');
|
||||
Route::get('accounts/{id}/following', 'PublicApiController@accountFollowing');
|
||||
Route::get('accounts/{id}/followers', 'PublicApiController@accountFollowers');
|
||||
Route::post('accounts/{id}/block', 'Api\ApiV1Controller@accountBlockById');
|
||||
Route::post('accounts/{id}/unblock', 'Api\ApiV1Controller@accountUnblockById');
|
||||
Route::get('statuses/{id}', 'PublicApiController@getStatus');
|
||||
|
|
Loading…
Reference in a new issue