mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +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);
|
abort_if(!$request->user(), 403);
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'page' => 'sometimes|int|min:1|max:40',
|
'page' => 'sometimes|int|min:1|max:20',
|
||||||
'limit' => 'sometimes|int|min:1|max:10'
|
'limit' => 'sometimes|int|min:1|max:10'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -273,7 +273,9 @@ class BaseApiController extends Controller
|
||||||
->latest()
|
->latest()
|
||||||
->simplePaginate($limit)
|
->simplePaginate($limit)
|
||||||
->map(function($id) {
|
->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) {
|
->filter(function($post) {
|
||||||
return $post && isset($post['account']);
|
return $post && isset($post['account']);
|
||||||
|
|
Loading…
Reference in a new issue