From 4fa06aa82829bac562db64a9036baa35a72ff49d Mon Sep 17 00:00:00 2001 From: bitbucket Date: Thu, 11 Apr 2024 10:42:05 +0530 Subject: [PATCH] CHANGES-in-employeeUpload-api-fixed-error:GWM --- app/Config/Routes.php | 4 +--- app/Controllers/EmployeeRestController.php | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 70f2acf0..b3bdb75b 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -236,11 +236,9 @@ $routes->group("/api", ["filter" => "authJWT"], function($routes){ -$routes->post("/editEmployeeProfile", "EmployeeRestController::editEmployeeProfile"); - $routes->group("employeeRest", ["filter" => "authJWT"], function($routes){ - $routes->get("/getEmployeeProfile", "EmployeeRestController::getEmployeeProfile/$1"); + $routes->get("getEmployeeProfile", "EmployeeRestController::getEmployeeProfile"); $routes->post("employeeUpload", "EmployeeRestController::employeeUpload"); $routes->get("relationshipList", "EmployeeRestController::relationshipList"); $routes->get("getEmployeeAndDependence", "EmployeeRestController::getEmployeeAndDependence"); diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 2481387c..a6eb068b 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -570,7 +570,7 @@ class EmployeeRestController extends AdminController $jwt = $this->request->getHeader('Authorization'); $jwtParts = explode(' ', $jwt); - $token = $jwtParts[1]; + $token = $jwtParts[2]; $decodedPayload = json_decode(base64_decode(explode('.', $token)[1]), true); @@ -585,8 +585,9 @@ class EmployeeRestController extends AdminController $policy = $this->policesModel->where('id', $client_policy['policy_id'])->first(); $policy_permium_1 = $this->policyPremium1Model->where(['client_id' => $client_id , 'client_policy_id' => $policy_id,'is_active' =>1])-> first(); $policy_permium_2 = $this->policyPremium2Model->where(['client_id' => $client_id , 'client_policy_id' => $policy_id,'is_active' =>1])-> first(); - $sum_insured_amount_for_check_employee_1 = $policy_permium_1['si']; - $sum_insured_amount_for_check_employee_2 = $policy_permium_2['si']; + + $sum_insured_amount_for_check_employee_1 = isset($policy_permium_1['si']) ? $policy_permium_1['si'] : null; + $sum_insured_amount_for_check_employee_2 = isset($policy_permium_2['si']) ? $policy_permium_2['si'] : null; $is_moved = $file->move(WRITEPATH . 'uploads/import_excel'); $filename = $file->getName();