GWM : add dependent api

This commit is contained in:
Gowtham M 2025-06-13 09:54:03 +05:30
parent 0696a5a35e
commit e75c769801
2 changed files with 26 additions and 1 deletions

View File

@ -435,6 +435,7 @@ $routes->post("/employeeRest/verifyEmployeeEmailId", "RestAuthenticationControll
//HR login api's //HR login api's
$routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber"); $routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber");
$routes->post("/employeeRest/verifyHrWithEmail", "RestAuthenticationController::verifyHrWithEmail");
$routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData"); $routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData");
$routes->group("/api", ["filter" => "authJWT"], function ($routes) { $routes->group("/api", ["filter" => "authJWT"], function ($routes) {

View File

@ -292,6 +292,30 @@ class RestAuthenticationController extends AdminController
} }
} }
public function verifyHrWithEmail()
{
try {
$email = $this->request->getJSON()->email;
$HrData = $this->hrModel->where('email', $email)
->where('contact_type', 'client')
->where('is_active', 1)
->first();
if ($HrData) {
$result = ['user_verification' => true ,'message' => "Verified Successfully"];
return $this->respond(['status' => 'success','code' => 200,'data' => $result],200);
} else {
// Call the third-party API function
return $this->callThirdPartyAPI($this->request->getJSON(),'verifyHrWithEmail');
}
} catch (\Throwable $th) {
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
}
}
public function getVerifiedHrData() public function getVerifiedHrData()
{ {