From eb0e0bc7d93735d5ba2ca491a7e044798b80fd23 Mon Sep 17 00:00:00 2001 From: Srinivas-Saravanan Date: Sat, 29 Mar 2025 16:16:18 +0530 Subject: [PATCH] TEMP_FIX_REST_CONTROLLER --- app/Config/Routes.php | 2 +- app/Controllers/RestAuthenticationController.php | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 836cc7c..15a0e52 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -449,7 +449,7 @@ $routes->post("employeeRest/updateMpin", "RestAuthenticationController::updateMp $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { - $routes->post("getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData"); + // $routes->post("getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData"); $routes->post("storeFireBase", "EmployeeRestController::storeFireBase"); // $routes->post("updateMpin", "RestAuthenticationController::updateMpin"); diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 95ba5d5..577f0b9 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -440,10 +440,18 @@ class RestAuthenticationController extends AdminController $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'verifyMpin'); return $this->respond(['status' => 'success','code' => 200,'data' => $result , 'post_enrollment'=> json_decode($apiResponse, true)],200); } else { + // Call the third-party API function - $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'getVerifiedUserData'); - return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP", 'post_enrollment'=> json_decode($apiResponse, true)],200); - } + + $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'/employeeRest/verifyMpin'); + + return $this->respond(['status' => 'success','code' => 200 , 'post_enrollment'=> json_decode($apiResponse, true)],200); + + //$apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'/getVerifiedUserData'); + + // return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP", 'post_enrollment'=> json_decode($apiResponse, true)],200); + + } } catch (\Exception $e) { return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500); }