Added _parseData to method postPrestudent of controller Prestudent

This commit is contained in:
bison-paolo
2016-09-29 14:46:29 +02:00
parent ad3c0b2d21
commit 9a8863e5ef
@@ -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);