mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 09:43:16 +00:00
Update PublicApiController, fix public timeline endpoint
This commit is contained in:
parent
80c7def3df
commit
dcb7ba9c7a
1 changed files with 6 additions and 1 deletions
|
@ -323,6 +323,9 @@ class PublicApiController extends Controller
|
||||||
->get()
|
->get()
|
||||||
->map(function($s) use ($user) {
|
->map(function($s) use ($user) {
|
||||||
$status = StatusService::getFull($s->id, $user->profile_id);
|
$status = StatusService::getFull($s->id, $user->profile_id);
|
||||||
|
if(!$status) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$status['favourited'] = (bool) LikeService::liked($user->profile_id, $s->id);
|
$status['favourited'] = (bool) LikeService::liked($user->profile_id, $s->id);
|
||||||
return $status;
|
return $status;
|
||||||
})
|
})
|
||||||
|
@ -362,6 +365,9 @@ class PublicApiController extends Controller
|
||||||
->get()
|
->get()
|
||||||
->map(function($s) use ($user) {
|
->map(function($s) use ($user) {
|
||||||
$status = StatusService::getFull($s->id, $user->profile_id);
|
$status = StatusService::getFull($s->id, $user->profile_id);
|
||||||
|
if(!$status) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$status['favourited'] = (bool) LikeService::liked($user->profile_id, $s->id);
|
$status['favourited'] = (bool) LikeService::liked($user->profile_id, $s->id);
|
||||||
return $status;
|
return $status;
|
||||||
})
|
})
|
||||||
|
@ -777,7 +783,6 @@ class PublicApiController extends Controller
|
||||||
$visibility = ['public', 'unlisted'];
|
$visibility = ['public', 'unlisted'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$dir = $min_id ? '>' : '<';
|
$dir = $min_id ? '>' : '<';
|
||||||
$id = $min_id ?? $max_id;
|
$id = $min_id ?? $max_id;
|
||||||
$res = Status::whereProfileId($profile['id'])
|
$res = Status::whereProfileId($profile['id'])
|
||||||
|
|
Loading…
Reference in a new issue