Skip to content

Commit

Permalink
list polls only shows global polls
Browse files Browse the repository at this point in the history
  • Loading branch information
imorland committed Feb 1, 2024
1 parent 0a4dcf4 commit d130f6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d130f6b

Please sign in to comment.