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);