mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-08 09:08:41 +00:00
Tested method pull out
More pull out should be done and maybe moved to a new controller for SOLID!
This commit is contained in:
parent
8176ea2ca9
commit
39536551ee
|
|
@ -388,6 +388,14 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
return;
|
||||
}
|
||||
|
||||
$account = createAccountModel($request);
|
||||
AccountMapper::create($account);
|
||||
|
||||
$response->set('account', $account->jsonSerialize());
|
||||
}
|
||||
|
||||
private function createAccountModel($request) : Account
|
||||
{
|
||||
$account = new Account();
|
||||
$account->setStatus($request->getData('status'));
|
||||
$account->setType($request->getData('type'));
|
||||
|
|
@ -397,10 +405,6 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
$account->setName3($request->getData('name3'));
|
||||
$account->setEmail($request->getData('email'));
|
||||
$account->generatePassword($request->getData('password'));
|
||||
|
||||
AccountMapper::create($account);
|
||||
|
||||
$response->set('account', $account->jsonSerialize());
|
||||
}
|
||||
|
||||
public function apiAccountDelete(RequestAbstract $request, ResponseAbstract $response, $data = null)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user