mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-14 02:24:31 +00:00
Update ApiV1Controller
This commit is contained in:
parent
d122c2d042
commit
796ad37419
1 changed files with 14 additions and 1 deletions
|
@ -65,6 +65,7 @@ use App\Services\{
|
||||||
NetworkTimelineService,
|
NetworkTimelineService,
|
||||||
NotificationService,
|
NotificationService,
|
||||||
MediaPathService,
|
MediaPathService,
|
||||||
|
ProfileStatusService,
|
||||||
PublicTimelineService,
|
PublicTimelineService,
|
||||||
ReblogService,
|
ReblogService,
|
||||||
RelationshipService,
|
RelationshipService,
|
||||||
|
@ -3030,7 +3031,7 @@ class ApiV1Controller extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GET /api/v1/discover/accounts/popular
|
* GET /api/v1.1/discover/accounts/popular
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
@ -3058,6 +3059,18 @@ class ApiV1Controller extends Controller
|
||||||
->filter(function($profile) use($pid) {
|
->filter(function($profile) use($pid) {
|
||||||
return $profile['id'] != $pid;
|
return $profile['id'] != $pid;
|
||||||
})
|
})
|
||||||
|
->map(function($profile) {
|
||||||
|
$ids = collect(ProfileStatusService::get($profile['id'], 0, 9))
|
||||||
|
->map(function($id) {
|
||||||
|
return StatusService::get($id, true);
|
||||||
|
})
|
||||||
|
->filter(function($post) {
|
||||||
|
return $post && isset($post['id']);
|
||||||
|
})
|
||||||
|
->take(3);
|
||||||
|
$profile['recent_posts'] = $ids;
|
||||||
|
return $profile;
|
||||||
|
})
|
||||||
->take(6)
|
->take(6)
|
||||||
->values();
|
->values();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue