From 9a8863e5efc34105661e9765ad391e453edc3ff3 Mon Sep 17 00:00:00 2001 From: bison-paolo Date: Thu, 29 Sep 2016 14:46:29 +0200 Subject: [PATCH] Added _parseData to method postPrestudent of controller Prestudent --- application/controllers/api/v1/crm/Prestudent.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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);