diff --git a/application/controllers/api/v1/crm/Prestudent.php b/application/controllers/api/v1/crm/Prestudent.php index 11d24204a..7e963b42a 100644 --- a/application/controllers/api/v1/crm/Prestudent.php +++ b/application/controllers/api/v1/crm/Prestudent.php @@ -71,15 +71,17 @@ class Prestudent extends APIv1_Controller */ public function postPrestudent() { - if ($this->_validate($this->post())) + $prestudent = $this->_parseData($this->post()); + + if ($this->_validate($prestudent)) { - if (isset($this->post()["prestudent_id"])) + if (isset($prestudent["prestudent_id"])) { - $result = $this->PrestudentModel->update($this->post()["prestudent_id"], $this->post()); + $result = $this->PrestudentModel->update($prestudent["prestudent_id"], $prestudent); } else { - $result = $this->PrestudentModel->insert($this->post()); + $result = $this->PrestudentModel->insert($prestudent); } $this->response($result, REST_Controller::HTTP_OK);