1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 22:40:55 +01:00

Update Feed for handleRequest

Summary: Updated Feed

Test Plan: Visit feed, see feed

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D13734
This commit is contained in:
Chad Little 2015-07-27 08:07:12 -07:00
parent c026152833
commit 55b685d3fc
2 changed files with 9 additions and 19 deletions

View file

@ -2,19 +2,13 @@
final class PhabricatorFeedDetailController extends PhabricatorFeedController { final class PhabricatorFeedDetailController extends PhabricatorFeedController {
private $id; public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
public function willProcessRequest(array $data) { $id = $request->getURIData('id');
$this->id = $data['id'];
}
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$story = id(new PhabricatorFeedQuery()) $story = id(new PhabricatorFeedQuery())
->setViewer($user) ->setViewer($viewer)
->withChronologicalKeys(array($this->id)) ->withChronologicalKeys(array($id))
->executeOne(); ->executeOne();
if (!$story) { if (!$story) {
return new Aphront404Response(); return new Aphront404Response();
@ -27,7 +21,7 @@ final class PhabricatorFeedDetailController extends PhabricatorFeedController {
$feed = array($story); $feed = array($story);
$builder = new PhabricatorFeedBuilder($feed); $builder = new PhabricatorFeedBuilder($feed);
$builder->setUser($user); $builder->setUser($viewer);
$feed_view = $builder->buildView(); $feed_view = $builder->buildView();
$title = pht('Story'); $title = pht('Story');

View file

@ -2,19 +2,15 @@
final class PhabricatorFeedListController extends PhabricatorFeedController { final class PhabricatorFeedListController extends PhabricatorFeedController {
private $queryKey;
public function shouldAllowPublic() { public function shouldAllowPublic() {
return true; return true;
} }
public function willProcessRequest(array $data) { public function handleRequest(AphrontRequest $request) {
$this->queryKey = idx($data, 'queryKey'); $querykey = $request->getURIData('queryKey');
}
public function processRequest() {
$controller = id(new PhabricatorApplicationSearchController()) $controller = id(new PhabricatorApplicationSearchController())
->setQueryKey($this->queryKey) ->setQueryKey($querykey)
->setSearchEngine(new PhabricatorFeedSearchEngine()) ->setSearchEngine(new PhabricatorFeedSearchEngine())
->setNavigation($this->buildSideNavView()); ->setNavigation($this->buildSideNavView());