fix crud valueset
This commit is contained in:
parent
ab0d6f0585
commit
23db830fe7
@ -61,9 +61,9 @@ class ValueSet extends Controller {
|
|||||||
try {
|
try {
|
||||||
$input = $this->request->getJSON(true);
|
$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());
|
return $this->failValidationErrors($this->validator->getErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ class ValueSet extends Controller {
|
|||||||
$this->db->transStart();
|
$this->db->transStart();
|
||||||
|
|
||||||
// Insert
|
// Insert
|
||||||
$this->db->table('valueset')->insert($data);
|
$this->db->table('valueset')->insert($dataValueSet);
|
||||||
|
|
||||||
// Complete transaction
|
// Complete transaction
|
||||||
$this->db->transComplete();
|
$this->db->transComplete();
|
||||||
|
|||||||
@ -61,7 +61,7 @@ class ValueSetField extends Controller {
|
|||||||
public function create() {
|
public function create() {
|
||||||
try {
|
try {
|
||||||
$input = $this->request->getJSON(true);
|
$input = $this->request->getJSON(true);
|
||||||
$dataValueSetFld = $this->prepareData($input);
|
$dataValueSetFld = $this->prepareValueSetFldData($input);
|
||||||
|
|
||||||
if (!$this->validateData($dataValueSetFld, $this->rulesValueSetFld)) {
|
if (!$this->validateData($dataValueSetFld, $this->rulesValueSetFld)) {
|
||||||
return $this->failValidationErrors($this->validator->getErrors());
|
return $this->failValidationErrors($this->validator->getErrors());
|
||||||
@ -100,7 +100,7 @@ class ValueSetField extends Controller {
|
|||||||
if (!$VSFldID) {
|
if (!$VSFldID) {
|
||||||
return $this->failValidationErrors('VSFldID is required.');
|
return $this->failValidationErrors('VSFldID is required.');
|
||||||
}
|
}
|
||||||
$dataValueSetFld = $this->prepareDataValueSetFld($input);
|
$dataValueSetFld = $this->prepareValueSetFldData($input);
|
||||||
|
|
||||||
if (!$this->validateData($dataValueSetFld, $this->rulesValueSetFld)) {
|
if (!$this->validateData($dataValueSetFld, $this->rulesValueSetFld)) {
|
||||||
return $this->failValidationErrors( $this->validator->getErrors());
|
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 = [
|
$data = [
|
||||||
"VSet" => $input['VSet'] ?? null,
|
"VSet" => $input['VSet'] ?? null,
|
||||||
"VSName" => $input['VSName'] ?? null,
|
"VSName" => $input['VSName'] ?? null,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user