diff --git a/api/application/config/constants.php b/api/application/config/constants.php index d6b0dad2..eaf94f3c 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -86,7 +86,7 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto // define login route name for token verification //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listLessPDDetails/:any)'); // no errors -defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'triggerNewPD'); // no errors +defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'saveNewQuestion'); // no errors /*********************AWS resources Constants*************************************************/ defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic'); diff --git a/api/application/controllers/Question_Management_Controller.php b/api/application/controllers/Question_Management_Controller.php index 5a633ccf..e39926a5 100644 --- a/api/application/controllers/Question_Management_Controller.php +++ b/api/application/controllers/Question_Management_Controller.php @@ -23,13 +23,13 @@ class Question_Management_Controller extends REST_Controller { public function listAllQuestions_get() { - $page = 0;$limit = 50;$sort = 'ASC'; + $page = 0;$limit = 0;$sort = 'ASC'; if($this->get('page')) { $page = $this->get('page'); } if($this->get('limit')){ $limit = $this->get('limit'); } if($this->get('sort')) { $sort = $this->get('sort'); } - $result = $this->Question_Management_Model->$listAllQuestions($page,$limit,$sort); + $result = $this->Question_Management_Model->listAllQuestions($page,$limit,$sort); if($result['data_status']) { $data['dataStatus'] = true; @@ -58,7 +58,7 @@ class Question_Management_Controller extends REST_Controller { unset($records['ansewrs']); } - $question_id = $this->db->saveRecords($records,QUESTIONS); + $question_id = $this->Question_Management_Model->saveRecords($records,QUESTIONS); if($question_id != '' || $question_id != null) { diff --git a/api/application/models/Question_Management_Model.php b/api/application/models/Question_Management_Model.php index 6de4bde1..90cbce66 100644 --- a/api/application/models/Question_Management_Model.php +++ b/api/application/models/Question_Management_Model.php @@ -14,7 +14,7 @@ class Question_Management_Model extends SPARQ_Model { { - $this->db->SELECT('QUESTIONS.question_id, QUESTIONS.question, QUESTIONS.description, QUESTIONS.fk_question_catagory,QUESTIONCATEGORY.category_name, QUESTIONS.fk_question_answertype,QUESTIONANSWERTYPE.answer_type_name,QUESTIONS.isactive, QUESTIONS.createdon, QUESTIONS.fk_createdby, QUESTIONS.updatedon, QUESTIONS.fk_updatedby,concat(USERPROFILE.first_name," " ,USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby'); + $this->db->SELECT('QUESTIONS.question_id, QUESTIONS.question, QUESTIONS.description, QUESTIONS.fk_question_catagory,QUESTIONCATEGORY.categroy_name, QUESTIONS.fk_question_answertype,QUESTIONANSWERTYPE.answer_type_name,QUESTIONS.isactive, QUESTIONS.createdon, QUESTIONS.fk_createdby, QUESTIONS.updatedon, QUESTIONS.fk_updatedby,concat(USERPROFILE.first_name," " ,USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby'); $this->db->FROM(QUESTIONS.' as QUESTIONS'); $this->db->JOIN(QUESTIONANSWERTYPE.' as QUESTIONANSWERTYPE','QUESTIONS.fk_question_answertype = QUESTIONANSWERTYPE.question_answer_type_id AND QUESTIONANSWERTYPE.isactive = 1'); $this->db->JOIN(QUESTIONCATEGORY.' as QUESTIONCATEGORY','QUESTIONS.fk_question_catagory = QUESTIONCATEGORY.question_categroy_id AND QUESTIONCATEGORY.isactive = 1');