From 23db830fe7e45f52cd443d9b6e659bc0fc0cb82f Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Tue, 16 Sep 2025 16:41:09 +0700 Subject: [PATCH] fix crud valueset --- app/Controllers/ValueSet.php | 6 +++--- app/Controllers/ValueSetField.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Controllers/ValueSet.php b/app/Controllers/ValueSet.php index 3b30740..ce8083d 100644 --- a/app/Controllers/ValueSet.php +++ b/app/Controllers/ValueSet.php @@ -61,9 +61,9 @@ class ValueSet extends Controller { try { $input = $this->request->getJSON(true); - $dataValueSet = $this->prepareDataValueSet($input); + $dataValueSet = $this->prepareValueSetData($input); - if (!$this->validateData($data, $this->rulesValueSet)) { + if (!$this->validateData($dataValueSet, $this->rulesValueSet)) { return $this->failValidationErrors($this->validator->getErrors()); } @@ -71,7 +71,7 @@ class ValueSet extends Controller { $this->db->transStart(); // Insert - $this->db->table('valueset')->insert($data); + $this->db->table('valueset')->insert($dataValueSet); // Complete transaction $this->db->transComplete(); diff --git a/app/Controllers/ValueSetField.php b/app/Controllers/ValueSetField.php index 9d8620c..f9208ba 100644 --- a/app/Controllers/ValueSetField.php +++ b/app/Controllers/ValueSetField.php @@ -61,7 +61,7 @@ class ValueSetField extends Controller { public function create() { try { $input = $this->request->getJSON(true); - $dataValueSetFld = $this->prepareData($input); + $dataValueSetFld = $this->prepareValueSetFldData($input); if (!$this->validateData($dataValueSetFld, $this->rulesValueSetFld)) { return $this->failValidationErrors($this->validator->getErrors()); @@ -100,7 +100,7 @@ class ValueSetField extends Controller { if (!$VSFldID) { return $this->failValidationErrors('VSFldID is required.'); } - $dataValueSetFld = $this->prepareDataValueSetFld($input); + $dataValueSetFld = $this->prepareValueSetFldData($input); if (!$this->validateData($dataValueSetFld, $this->rulesValueSetFld)) { return $this->failValidationErrors( $this->validator->getErrors()); @@ -161,7 +161,7 @@ class ValueSetField extends Controller { } } - private function prepareDataValueSetFld(array $input): array { + private function prepareValueSetFldData(array $input): array { $data = [ "VSet" => $input['VSet'] ?? null, "VSName" => $input['VSName'] ?? null,