fix crud valueset
This commit is contained in:
parent
ab0d6f0585
commit
23db830fe7
@ -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();
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user