mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
Update PublicApiController
This commit is contained in:
parent
79da0692b4
commit
292e6e18b1
1 changed files with 4 additions and 4 deletions
|
@ -528,8 +528,8 @@ class PublicApiController extends Controller
|
||||||
{
|
{
|
||||||
abort_unless(Auth::check(), 403);
|
abort_unless(Auth::check(), 403);
|
||||||
$profile = Profile::with('user')->whereNull('status')->whereNull('domain')->findOrFail($id);
|
$profile = Profile::with('user')->whereNull('status')->whereNull('domain')->findOrFail($id);
|
||||||
if($profile->is_private || !$profile->user->settings->show_profile_followers) {
|
if($profile->is_private || !$profile->user->settings->show_profile_followers && Auth::id() != $profile->user_id) {
|
||||||
return [];
|
return response()->json([]);
|
||||||
}
|
}
|
||||||
$followers = $profile->followers()->orderByDesc('followers.created_at')->paginate(10);
|
$followers = $profile->followers()->orderByDesc('followers.created_at')->paginate(10);
|
||||||
$resource = new Fractal\Resource\Collection($followers, new AccountTransformer());
|
$resource = new Fractal\Resource\Collection($followers, new AccountTransformer());
|
||||||
|
@ -542,8 +542,8 @@ class PublicApiController extends Controller
|
||||||
{
|
{
|
||||||
abort_unless(Auth::check(), 403);
|
abort_unless(Auth::check(), 403);
|
||||||
$profile = Profile::with('user')->whereNull('status')->whereNull('domain')->findOrFail($id);
|
$profile = Profile::with('user')->whereNull('status')->whereNull('domain')->findOrFail($id);
|
||||||
if($profile->is_private || !$profile->user->settings->show_profile_following) {
|
if($profile->is_private || !$profile->user->settings->show_profile_following && Auth::id() != $profile->user_id) {
|
||||||
return [];
|
return response()->json([]);
|
||||||
}
|
}
|
||||||
$following = $profile->following()->orderByDesc('followers.created_at')->paginate(10);
|
$following = $profile->following()->orderByDesc('followers.created_at')->paginate(10);
|
||||||
$resource = new Fractal\Resource\Collection($following, new AccountTransformer());
|
$resource = new Fractal\Resource\Collection($following, new AccountTransformer());
|
||||||
|
|
Loading…
Reference in a new issue