From ce4312fc8db9959b084fbe327554294b3f6f4760 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Thu, 11 Jul 2024 14:58:30 +0530 Subject: [PATCH] CHANGE_ mpin status api : GWM --- app/Config/Routes.php | 1 + .../RestAuthenticationController.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index f4df6e62..4778427f 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -272,6 +272,7 @@ $routes->get("processjob", "JobWorker::processJob"); $routes->post("/employeeRest/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber"); $routes->post("/employeeRest/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData"); $routes->post("/employeeRest/verifyMpin", "RestAuthenticationController::verifyMpin"); +$routes->post("/employeeRest/checkMpin", "RestAuthenticationController::checkMpin"); //HR login api's $routes->post("/employeeRest/verifyHrWithMobileNumber", "RestAuthenticationController::verifyHrWithMobileNumber"); $routes->post("/employeeRest/getVerifiedHrData", "RestAuthenticationController::getVerifiedHrData"); diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 4e5cf279..7c7358f7 100644 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -310,6 +310,25 @@ class RestAuthenticationController extends AdminController } } + public function checkMpin() + { + try { + $mobile_number = $this->request->getJSON()->mobile_number; + + + $employeeData = $this->employeeModel->where('mobile', $mobile_number)->where('relationship', 'self')->first(); + + if ($employeeData && $employeeData["mpin"] != null) { + + return $this->respond(['status' => 'success','code' => 200,'data' => "Mpin - exist"],200); + } else { + return $this->respond(['status' => 'failed','code' => 404,'data' => "Mpin - not found"],200); + } + } catch (\Exception $e) { + return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getMessage()],500); + } + } + } \ No newline at end of file