diff --git a/src/applications/slowvote/conduit/SlowvoteInfoConduitAPIMethod.php b/src/applications/slowvote/conduit/SlowvoteInfoConduitAPIMethod.php index cecd799ad0..4041b1f70c 100644 --- a/src/applications/slowvote/conduit/SlowvoteInfoConduitAPIMethod.php +++ b/src/applications/slowvote/conduit/SlowvoteInfoConduitAPIMethod.php @@ -1,47 +1,53 @@ 'required id', ); } protected function defineReturnType() { return 'nonempty dict'; } protected function defineErrorTypes() { return array( 'ERR_BAD_POLL' => pht('No such poll exists.'), ); } protected function execute(ConduitAPIRequest $request) { + $viewer = $this->getViewer(); + $poll_id = $request->getValue('poll_id'); - $poll = id(new PhabricatorSlowvotePoll())->load($poll_id); + + $poll = id(new PhabricatorSlowvoteQuery()) + ->setViewer($viewer) + ->withIDs(array($poll_id)) + ->executeOne(); if (!$poll) { throw new ConduitException('ERR_BAD_POLL'); } $result = array( 'id' => $poll->getID(), 'phid' => $poll->getPHID(), 'authorPHID' => $poll->getAuthorPHID(), 'question' => $poll->getQuestion(), 'uri' => PhabricatorEnv::getProductionURI('/V'.$poll->getID()), ); return $result; } }