mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-02-13 11:28:41 +00:00
rename request variables
This commit is contained in:
parent
b171cf42e3
commit
29ee4f20c6
|
|
@ -53,6 +53,8 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
if ($request->getData('profiles') !== null) {
|
if ($request->getData('profiles') !== null) {
|
||||||
$this->apiEmployeeFromAccountCreate($request, $response, $data);
|
$this->apiEmployeeFromAccountCreate($request, $response, $data);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->apiEmployeeNewCreate($request, $response, $data);
|
$this->apiEmployeeNewCreate($request, $response, $data);
|
||||||
|
|
@ -97,7 +99,7 @@ final class ApiController extends Controller
|
||||||
private function validateEmployeeFromAccountCreate(RequestAbstract $request) : array
|
private function validateEmployeeFromAccountCreate(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$val = [];
|
$val = [];
|
||||||
if (($val['profile'] = empty($request->getData('profiles')))) {
|
if (($val['profiles'] = empty($request->getData('profiles')))) {
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -115,12 +117,9 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
private function createEmployeeFromAccountFromRequest(RequestAbstract $request) : array
|
private function createEmployeeFromAccountFromRequest(RequestAbstract $request) : array
|
||||||
{
|
{
|
||||||
$accounts = $request->getData('profiles') ?? [];
|
$accounts = $request->getDataList('profiles') ?? [];
|
||||||
if (!\is_array($accounts)) {
|
|
||||||
$accounts = [$accounts];
|
|
||||||
}
|
|
||||||
|
|
||||||
$employees = [];
|
$employees = [];
|
||||||
|
|
||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
$employees[] = new Employee((int) $account);
|
$employees[] = new Employee((int) $account);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user