diff --git a/extend.php b/extend.php index 8b7b50c2..29148236 100755 --- a/extend.php +++ b/extend.php @@ -37,7 +37,7 @@ (new Extend\Routes('api')) ->post('/fof/polls', 'fof.polls.create', Controllers\CreatePollController::class) - ->get('/fof/polls', 'fof.polls.index', Controllers\ListPollsController::class) + ->get('/fof/polls', 'fof.polls.index', Controllers\ListGlobalPollsController::class) ->get('/fof/polls/{id}', 'fof.polls.show', Controllers\ShowPollController::class) ->patch('/fof/polls/{id}', 'fof.polls.edit', Controllers\EditPollController::class) ->delete('/fof/polls/{id}', 'fof.polls.delete', Controllers\DeletePollController::class) diff --git a/src/Api/Controllers/ListPollsController.php b/src/Api/Controllers/ListGlobalPollsController.php similarity index 95% rename from src/Api/Controllers/ListPollsController.php rename to src/Api/Controllers/ListGlobalPollsController.php index d8dfef4a..c68d983a 100644 --- a/src/Api/Controllers/ListPollsController.php +++ b/src/Api/Controllers/ListGlobalPollsController.php @@ -20,7 +20,7 @@ use Psr\Http\Message\ServerRequestInterface; use Tobscure\JsonApi\Document; -class ListPollsController extends AbstractListController +class ListGlobalPollsController extends AbstractListController { public $serializer = PollSerializer::class; @@ -62,7 +62,7 @@ public function data(ServerRequestInterface $request, Document $document): Colle $results = $this->polls->queryVisibleTo($actor) ->select('polls.*') - //->whereNull('post_id') + ->whereNull('post_id') ->orderBy($sortIsDefault ? 'id' : $sort, 'desc') ->skip($offset) ->take($limit);