diff --git a/.github/user_bug_report.md b/.github/user_bug_report.md index 9e5f2a5..4b92a8e 100755 --- a/.github/user_bug_report.md +++ b/.github/user_bug_report.md @@ -8,9 +8,11 @@ assignees: '' --- # Bug Description + A clear and concise description of what the bug is. # How to Reproduce + Steps to reproduce the behavior: 1. Go to '...' @@ -19,16 +21,20 @@ Steps to reproduce the behavior: 4. See error # Expected Behavior + A clear and concise description of what you expected to happen. # Screenshots + If applicable, add screenshots to help explain your problem. # System Information - - System: [e.g. PC or iPhone11, ...] - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - KarakaVersion [e.g. 22] + +- System: [e.g. PC or iPhone11, ...] +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- KarakaVersion [e.g. 22] # Additional Information + Add any other context about the problem here. diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 6bec3a9..ffa41c4 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -108,7 +108,7 @@ final class ApiController extends Controller private function validateEmployeeFromAccountCreate(RequestAbstract $request) : array { $val = []; - if (($val['profiles'] = empty($request->getData('profiles')))) { + if (($val['profiles'] = !$request->hasData('profiles'))) { return $val; } @@ -177,7 +177,7 @@ final class ApiController extends Controller private function validateEmployeeNewCreate(RequestAbstract $request) : array { $val = []; - if (($val['name1'] = empty($request->getData('name1')))) { + if (($val['name1'] = !$request->hasData('name1'))) { return $val; } @@ -248,11 +248,11 @@ final class ApiController extends Controller private function validateEmployeeHistoryCreate(RequestAbstract $request) : array { $val = []; - if (($val['employee'] = empty($request->getData('employee'))) - || ($val['start'] = empty($request->getData('start'))) - || ($val['unit'] = empty($request->getData('unit'))) - || ($val['department'] = empty($request->getData('department'))) - || ($val['position'] = empty($request->getData('position'))) + if (($val['employee'] = !$request->hasData('employee')) + || ($val['start'] = !$request->hasData('start')) + || ($val['unit'] = !$request->hasData('unit')) + || ($val['department'] = !$request->hasData('department')) + || ($val['position'] = !$request->hasData('position')) ) { return $val; } @@ -320,10 +320,10 @@ final class ApiController extends Controller private function validateEmployeeWorkHistoryCreate(RequestAbstract $request) : array { $val = []; - if (($val['employee'] = empty($request->getData('employee'))) - || ($val['start'] = empty($request->getData('start'))) - || ($val['title'] = empty($request->getData('title'))) - || ($val['name'] = empty($request->getData('name'))) + if (($val['employee'] = !$request->hasData('employee')) + || ($val['start'] = !$request->hasData('start')) + || ($val['title'] = !$request->hasData('title')) + || ($val['name'] = !$request->hasData('name')) ) { return $val; } @@ -396,10 +396,10 @@ final class ApiController extends Controller private function validateEmployeeEducationHistoryCreate(RequestAbstract $request) : array { $val = []; - if (($val['employee'] = empty($request->getData('employee'))) - || ($val['start'] = empty($request->getData('start'))) - || ($val['title'] = empty($request->getData('title'))) - || ($val['name'] = empty($request->getData('name'))) + if (($val['employee'] = !$request->hasData('employee')) + || ($val['start'] = !$request->hasData('start')) + || ($val['title'] = !$request->hasData('title')) + || ($val['name'] = !$request->hasData('name')) ) { return $val; }