From e2a93aeb2e212bfef087655dca3b452a8150bcb5 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Fri, 13 Feb 2026 13:03:33 +0530 Subject: [PATCH] FIX_ISSUE --- app/Controllers/UserController.php | 22 +++++++------------ app/Views/UserList.php | 16 +++++++++----- .../policy_transaction_inception_form.php | 4 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/Controllers/UserController.php b/app/Controllers/UserController.php index 8e3c702b..3659369b 100755 --- a/app/Controllers/UserController.php +++ b/app/Controllers/UserController.php @@ -178,13 +178,10 @@ class UserController extends AdminController ] ], ]; - if (!$this->validate($rules)) { - return $this->response->setStatusCode(400)->setJSON([ - 'status' => false, - 'message' => 'Input validation failed', - 'code' => 400, - 'errors' => $this->validator->getErrors() - ]); + if (!$this->validate($rules)) { + return redirect()->to(base_url('/user/list')) + ->withInput() + ->with('errors', $this->validator->getErrors()); } $userData['created_by'] = get_session_userid(); @@ -363,12 +360,9 @@ class UserController extends AdminController ], ]; if (!$this->validate($rules)) { - return $this->response->setStatusCode(400)->setJSON([ - 'status' => false, - 'message' => 'Input validation failed', - 'code' => 400, - 'errors' => $this->validator->getErrors() - ]); + return redirect()->to(base_url('/user/list')) + ->withInput() + ->with('errors', $this->validator->getErrors()); } $data = $this->request->getPost(); @@ -845,7 +839,7 @@ class UserController extends AdminController ], 'errors' => [ 'required' => 'Retention Rate is required', - 'regex_match' => 'Retention Rate must be between 0 and 100 with up to 2 decimal places' + 'regex_match' => 'Retention Rate must be between 0 to 100 with up to 2 decimal places' ] ], // ====================== diff --git a/app/Views/UserList.php b/app/Views/UserList.php index 571ddda9..919e7de1 100755 --- a/app/Views/UserList.php +++ b/app/Views/UserList.php @@ -884,12 +884,18 @@ table.dataTable tbody td { + +getFlashdata('errors')): ?> + + + getFlashdata('error')) : ?> - getFlashdata('error') as $error) : ?> - -