mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-01-27 04:28:41 +00:00
Implement tests
This commit is contained in:
parent
a62a8d3507
commit
56eded102a
|
|
@ -370,16 +370,12 @@ final class ApiController extends Controller
|
|||
if (((string) ($request->getData('password') ?? '')) !== ''
|
||||
&& ((string) ($request->getData('login') ?? '')) !== ''
|
||||
) {
|
||||
$this->app->moduleManager->get('Profile')->apiProfileCreateDbEntry(new \Modules\Profile\Models\Profile($account));
|
||||
$this->app->moduleManager->get('Profile')->apiProfileCreateDbEntry(new \Modules\Profile\Models\Profile($account), $request);
|
||||
|
||||
$this->app->eventManager->trigger('PRE:Module:Admin-account-update', '', $account);
|
||||
$account->setLoginTries((int) $this->app->appSettings->get(Settings::LOGIN_TRIES));
|
||||
AccountMapper::update($account);
|
||||
$this->app->eventManager->trigger('POST:Module:Admin-account-update', '', [
|
||||
$request->getHeader()->getAccount(),
|
||||
null,
|
||||
$account,
|
||||
]);
|
||||
$this->updateModel($request, $account, $account, function() use($account) {
|
||||
$account->setLoginTries((int) $this->app->appSettings->get(Settings::LOGIN_TRIES));
|
||||
AccountMapper::update($account);
|
||||
}, 'account');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -404,8 +400,6 @@ final class ApiController extends Controller
|
|||
$account->setEmail((string) ($request->getData('email') ?? ''));
|
||||
$account->generatePassword((string) ($request->getData('password') ?? ''));
|
||||
|
||||
// todo: set remaining login tries based on global default config here. but before you have to add it to the model and mapper
|
||||
|
||||
return $account;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user