Update ApiV1Controller

pull/3655/head
Daniel Supernault 2022-09-12 21:27:53 -06:00
rodzic d122c2d042
commit 796ad37419
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
1 zmienionych plików z 14 dodań i 1 usunięć

Wyświetl plik

@ -65,6 +65,7 @@ use App\Services\{
NetworkTimelineService,
NotificationService,
MediaPathService,
ProfileStatusService,
PublicTimelineService,
ReblogService,
RelationshipService,
@ -3030,7 +3031,7 @@ class ApiV1Controller extends Controller
}
/**
* GET /api/v1/discover/accounts/popular
* GET /api/v1.1/discover/accounts/popular
*
*
* @return array
@ -3058,6 +3059,18 @@ class ApiV1Controller extends Controller
->filter(function($profile) use($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)
->values();