/** * Update Product List * @return json * @author Ruslan Ushakov **/ public function updateProductList() { $listId = $this->input->get('listId'); $listName = $this->input->get('listName'); $success = false; if (!empty($listId) && !empty($listName)) { $list = $this->product_model->getProductList($listId, $this->getUserId(), $this->isAdmin()); if (!$list) { $this->output->set_content_type('application/json')->set_output(json_encode(array('error' => true, 'message' => 'You have no lists with such ID.'))); return; } $data = array('name' => trim($listName)); $success = $this->product_model->update($listId, $this->getUserId(), $data, $this->isAdmin()); } $this->jsonResponse(array('success' => $success)); }