mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +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:
parent
505b1d8379
commit
7fbb5f2d92
1 changed files with 3 additions and 11 deletions
|
@ -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(
|
||||
$accounts = PhortuneAccountQuery::loadAccountsForUser(
|
||||
$viewer,
|
||||
PhabricatorContentSource::newFromRequest($request));
|
||||
$accounts = array($account);
|
||||
}
|
||||
|
||||
if (count($accounts) == 1) {
|
||||
$account = head($accounts);
|
||||
|
|
Loading…
Reference in a new issue