diff --git a/src/applications/slowvote/conduit/SlowvoteInfoConduitAPIMethod.php b/src/applications/slowvote/conduit/SlowvoteInfoConduitAPIMethod.php index 4041b1f70c..1b4cde9191 100644 --- a/src/applications/slowvote/conduit/SlowvoteInfoConduitAPIMethod.php +++ b/src/applications/slowvote/conduit/SlowvoteInfoConduitAPIMethod.php @@ -1,53 +1,61 @@ '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 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; } }