mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-26 09:46:49 +00:00
Update ApiV1Controller, add pixelfed entity support to bookmarks endpoint
This commit is contained in:
parent
94e98507a5
commit
94069db9b8
1 changed files with 3 additions and 2 deletions
|
@ -3005,6 +3005,7 @@ class ApiV1Controller extends Controller
|
|||
'min_id' => 'nullable|integer|min:0'
|
||||
]);
|
||||
|
||||
$pe = $request->has('_pe');
|
||||
$pid = $request->user()->profile_id;
|
||||
$limit = $request->input('limit') ?? 20;
|
||||
$max_id = $request->input('max_id');
|
||||
|
@ -3018,8 +3019,8 @@ class ApiV1Controller extends Controller
|
|||
->orderByDesc('id')
|
||||
->cursorPaginate($limit);
|
||||
|
||||
$bookmarks = $bookmarkQuery->map(function($bookmark) use($pid) {
|
||||
$status = StatusService::getMastodon($bookmark->status_id, false);
|
||||
$bookmarks = $bookmarkQuery->map(function($bookmark) use($pid, $pe) {
|
||||
$status = $pe ? StatusService::get($bookmark->status_id, false) : StatusService::getMastodon($bookmark->status_id, false);
|
||||
|
||||
if($status) {
|
||||
$status['bookmarked'] = true;
|
||||
|
|
Loading…
Reference in a new issue