mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
(proxy) combine validate and save action
This commit is contained in:
parent
b7f55e9fcd
commit
20b2e7fecc
@ -101,23 +101,16 @@ class SettingsController extends ApiControllerBase
|
||||
$result["validations"]["proxy.".$msg->getField()] = $msg->getMessage();
|
||||
}
|
||||
|
||||
// serialize model to config
|
||||
// serialize model to config and save
|
||||
if ($valMsgs->count() == 0) {
|
||||
$mdlProxy->serializeToConfig();
|
||||
$cnf = Config::getInstance();
|
||||
$cnf->save();
|
||||
$result["result"] = "saved";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// save config if validated correctly
|
||||
if (!array_key_exists("validations", $result)) {
|
||||
$cnf = Config::getInstance();
|
||||
$cnf->save();
|
||||
$result["result"] = "saved";
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user