This commit is contained in:
Gowtham M 2025-10-14 10:42:14 +05:30
parent ca56be21b6
commit bf6a914ded
2 changed files with 17 additions and 0 deletions

View File

@ -41,6 +41,7 @@ $routes->group('api', ['filter' => 'appSignature'], function ($routes) {
//Agent
$routes->get('agent/agentList', 'AgentController::agentList');
$routes->get('agent/agentListForEnquiryCreationDropdown', 'AgentController::agentListForEnquiryCreationDropdown');
$routes->get('agent/findAgent', 'AgentController::findAgent');
$routes->post('agent/createAgent', 'AgentController::createAgent');
$routes->post('agent/updateAgent', 'AgentController::updateAgent');

View File

@ -34,6 +34,22 @@ class AgentController extends ResourceController
}
public function agentListForEnquiryCreationDropdown()
{
try{
$id = $this->request->getGet('manager_id');
$data = $this->AgentModel->where('manager_id' , $id )->where('is_active',1)->findAll();
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $data], 200);
} catch (\Exception $e) {
return $this->respond(['status' => 'failed', 'code' => 500, 'data' => $e->getMessage()], 500);
}
}
// Find a agent
public function findAgent()
{