From 054cf2f258b0613a34cfe5f40158bc9db05a7274 Mon Sep 17 00:00:00 2001 From: chfhtw Date: Mon, 23 Mar 2026 15:06:25 +0100 Subject: [PATCH] correct form validation & typo in api dashboard widget --- .../api/frontend/v1/dashboard/Widget.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/application/controllers/api/frontend/v1/dashboard/Widget.php b/application/controllers/api/frontend/v1/dashboard/Widget.php index cd01d9102..ac8c682e8 100644 --- a/application/controllers/api/frontend/v1/dashboard/Widget.php +++ b/application/controllers/api/frontend/v1/dashboard/Widget.php @@ -111,24 +111,24 @@ class Widget extends FHCAPI_Controller { $this->load->library('form_validation'); - $this->form_validation->set_rules('dashboard', 'Dashboard', 'required'); - $this->form_validation->set_rules('widget', 'Widget', 'required'); - $this->form_validation->set_rules('allowed', 'Allowed', 'required|is_bool'); + $this->form_validation->set_rules('dashboard_id', 'Dashboard', 'required'); + $this->form_validation->set_rules('widget_id', 'Widget', 'required'); + $this->form_validation->set_rules('allowed', 'Allowed', 'is_bool'); if (!$this->form_validation->run()) $this->terminateWithValidationErrors($this->form_validation->error_array()); $data = [ - 'dashboard_id' => $this->input->post('dashboard'), - 'widget_id' => $this->input->post('widget') + 'dashboard_id' => $this->input->post('dashboard_id'), + 'widget_id' => $this->input->post('widget_id') ]; $this->load->model('dashboard/Dashboard_Widget_model', 'DashboardWidgetModel'); if ($this->input->post('allowed')) - $result = $this->DashoardWidgetModel->insert($data); + $result = $this->DashboardWidgetModel->insert($data); else - $result = $this->DashoardWidgetModel->delete($data); + $result = $this->DashboardWidgetModel->delete($data); $data = $this->getDataOrTerminateWithError($result);