Commit 20b2e7fe authored by Ad Schellevis's avatar Ad Schellevis

(proxy) combine validate and save action

parent b7f55e9f
...@@ -101,23 +101,16 @@ class SettingsController extends ApiControllerBase ...@@ -101,23 +101,16 @@ class SettingsController extends ApiControllerBase
$result["validations"]["proxy.".$msg->getField()] = $msg->getMessage(); $result["validations"]["proxy.".$msg->getField()] = $msg->getMessage();
} }
// serialize model to config // serialize model to config and save
if ($valMsgs->count() == 0) { if ($valMsgs->count() == 0) {
$mdlProxy->serializeToConfig(); $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; return $result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment