1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Reduce some code duplication in PhortuneLandingController

Summary: Ref T12451. This code is the same as the other code.

Test Plan: Went through the default-account case with this code, worked the same as the other code.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12451

Differential Revision: https://secure.phabricator.com/D17693
This commit is contained in:
epriestley 2017-04-14 09:59:43 -07:00
parent 505b1d8379
commit 7fbb5f2d92

View file

@ -5,17 +5,9 @@ final class PhortuneLandingController extends PhortuneController {
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();
$accounts = id(new PhortuneAccountQuery())
->setViewer($viewer)
->withMemberPHIDs(array($viewer->getPHID()))
->execute();
if (!$accounts) {
$account = PhortuneAccount::createNewAccount(
$viewer,
PhabricatorContentSource::newFromRequest($request));
$accounts = array($account);
}
$accounts = PhortuneAccountQuery::loadAccountsForUser(
$viewer,
PhabricatorContentSource::newFromRequest($request));
if (count($accounts) == 1) {
$account = head($accounts);