GWM : add dependent api
This commit is contained in:
parent
0696a5a35e
commit
e75c769801
@ -435,6 +435,7 @@ $routes->post("/employeeRest/verifyEmployeeEmailId", "RestAuthenticationControll
|
||||
|
||||
//HR login api's
|
||||
$routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber");
|
||||
$routes->post("/employeeRest/verifyHrWithEmail", "RestAuthenticationController::verifyHrWithEmail");
|
||||
$routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData");
|
||||
|
||||
$routes->group("/api", ["filter" => "authJWT"], function ($routes) {
|
||||
|
||||
@ -291,6 +291,30 @@ class RestAuthenticationController extends AdminController
|
||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $th],500);
|
||||
}
|
||||
}
|
||||
|
||||
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()
|
||||
@ -329,7 +353,7 @@ class RestAuthenticationController extends AdminController
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
// 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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user