mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 01:05:36 +00:00
Update InternalApiController, add bookmarks api
This commit is contained in:
parent
e288b45c5b
commit
4c1d35cfa2
1 changed files with 14 additions and 0 deletions
|
@ -306,4 +306,18 @@ class InternalApiController extends Controller
|
|||
Cache::forget('profile:status_count:'.$profile->id);
|
||||
return $status->url();
|
||||
}
|
||||
|
||||
public function bookmarks(Request $request)
|
||||
{
|
||||
$statuses = Auth::user()->profile
|
||||
->bookmarks()
|
||||
->withCount(['likes','comments'])
|
||||
->orderBy('created_at', 'desc')
|
||||
->simplePaginate(10);
|
||||
|
||||
$resource = new Fractal\Resource\Collection($statuses, new StatusTransformer());
|
||||
$res = $this->fractal->createData($resource)->toArray();
|
||||
|
||||
return response()->json($res);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue