diff --git a/app/Config/Routes.php b/app/Config/Routes.php index cf04e22d..b701d493 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -290,6 +290,7 @@ $routes->group("/api", ["filter" => "authJWT"], function ($routes) { +$routes->get("getEmployeeActiveOrInactivePolicy", "EmployeeRestController::getEmployeeActiveOrInactivePolicy"); $routes->get("getChatResponse", "ChatBotController::getChatResponse"); $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 3851457e..80a6c14b 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -792,7 +792,7 @@ class EmployeeRestController extends AdminController 'emp_status'=>'draft', 'band'=> $extra['10'][$index], 'basic_pay'=> $extra['11'][$index], - 'unit'=> $extra['12'][$index], + 'unit'=> isset($extra['12'][$index]) ? $extra['12'][$index] : null, 'client_branch_id' => $client_branch_id ]; @@ -2104,9 +2104,8 @@ class EmployeeRestController extends AdminController function getEmployeeActiveOrInactivePolicy() { - if($this->request->getGet('type') == 'Active'){ $policy_status = 1; }else{ $policy_status = 0; } - $ClientPolicyData = $this->clientPolicyModel->select('client_policy.* , policies.name as policy_name , policy_type.policy_type as policy_type') + $ClientPolicyData = $this->clientPolicyModel->select('client_policy.* , policies.name as policy_name , policy_type.policy_type as policy_type') ->join('policies', 'client_policy.policy_id = policies.id', 'left') ->join('policy_type', 'client_policy.policy_type_id = policy_type.id', 'left') ->where('client_policy.client_id', $this->request->getGet('client_id') ) @@ -2368,7 +2367,7 @@ class EmployeeRestController extends AdminController return $this->respond(['status' => 'failed', 'code' => 500, 'message' => 'Failed to update employee data'], 500); } } else { - return $this->respond(['status' => 'failed', 'code' => 400, 'message' => 'New Firebase Token is the same as the current one'], 400); + return $this->respond(['status' => 'failed', 'code' => 400, 'message' => 'New Firebase Token is the same as the current one'], 200); } } else { return $this->respond(['status' => 'failed', 'code' => 400, 'message' => 'Firebase Token is required'], 400);