From 0696a5a35e8cc40f0afb92f62b00f66026cdace4 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Wed, 11 Jun 2025 16:33:50 +0530 Subject: [PATCH] HR login api correction : GWM --- app/Controllers/RestAuthenticationController.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index b2ab28b..354fe72 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -283,8 +283,8 @@ class RestAuthenticationController extends AdminController $result = ['user_verification' => true ,'message' => "Verified Successfully"]; return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); } else { - $result = ['user_verification' => false , 'message' => "User not found"]; - return $this->respond(['status' => 'failed','code' => 404,'data' => $result],200); + // Call the third-party API function + return $this->callThirdPartyAPI($this->request->getJSON(),'verifyHrWithMobileNumber'); } } catch (\Throwable $th) { @@ -322,9 +322,17 @@ class RestAuthenticationController extends AdminController ->find(); $result = JWTToken::encode($hrData['0']); - return $this->respond(['status' => 'success','code' => 200,'data' => $result],200); + + // Call the third-party API function + $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'getVerifiedHrData'); + return $this->respond(['status' => 'success','code' => 200,'data' => $result , 'post_enrollment'=> json_decode($apiResponse, true)],200); + + } else { - return $this->respond(['status' => 'failed','code' => 404,'data' => "Invalid OTP"],200); + + // Call the third-party API function + $apiResponse = $this->callThirdPartyAPI($this->request->getJSON(),'getVerifiedHrData'); + 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);