mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update BaseApiController, improve favourites endpoint
This commit is contained in:
parent
f063cb0185
commit
3d86d21be6
1 changed files with 4 additions and 2 deletions
|
@ -261,7 +261,7 @@ class BaseApiController extends Controller
|
|||
{
|
||||
abort_if(!$request->user(), 403);
|
||||
$this->validate($request, [
|
||||
'page' => 'sometimes|int|min:1|max:40',
|
||||
'page' => 'sometimes|int|min:1|max:20',
|
||||
'limit' => 'sometimes|int|min:1|max:10'
|
||||
]);
|
||||
|
||||
|
@ -273,7 +273,9 @@ class BaseApiController extends Controller
|
|||
->latest()
|
||||
->simplePaginate($limit)
|
||||
->map(function($id) {
|
||||
return StatusService::get($id->status_id, false);
|
||||
$status = StatusService::get($id->status_id, false);
|
||||
$status['favourited'] = true;
|
||||
return $status;
|
||||
})
|
||||
->filter(function($post) {
|
||||
return $post && isset($post['account']);
|
||||
|
|
Loading…
Reference in a new issue