API Calls codeception

Fixed translations
This commit is contained in:
paolo
2016-04-22 14:44:40 +02:00
parent 346b8c82e1
commit f6f533a23b
11 changed files with 85 additions and 15 deletions
@@ -39,11 +39,11 @@ class Person extends REST_Controller
$result = $this->PersonModel->getPerson($personID, $code, $email);
if(is_object($result))
if(is_object($result) && $result->num_rows() > 0)
{
$payload = [
'success' => TRUE,
'message' => 'People found',
'message' => 'Person found',
'data' => $result->result()
];
$httpstatus = REST_Controller::HTTP_OK;
@@ -32,7 +32,7 @@ class Course extends REST_Controller
{
$result = $this->CourseModel->getEnabledCourses();
if(is_object($result))
if(is_object($result) && $result->num_rows() > 0)
{
$payload = [
'success' => TRUE,
@@ -28,17 +28,17 @@ class Plan extends REST_Controller
$this->PlanModel->setAddonID($this->_getAddonID());
}
public function getCurricula()
public function getPlan()
{
$courseOfStudiesID = $this->get('studiengang_kz');
$result = $this->PlanModel->getCurricula($courseOfStudiesID);
$result = $this->PlanModel->getPlan($courseOfStudiesID);
if(is_object($result))
if(is_object($result) && $result->num_rows() > 0)
{
$payload = [
'success' => TRUE,
'message' => 'Curricula found',
'message' => 'Plan found',
'data' => $result->result()
];
$httpstatus = REST_Controller::HTTP_OK;
@@ -47,7 +47,7 @@ class Plan extends REST_Controller
{
$payload = [
'success' => FALSE,
'message' => 'Curricula not found'
'message' => 'Plan not found'
];
$httpstatus = REST_Controller::HTTP_OK;
}