ConfigController: use new response handling

This commit is contained in:
Thomas Gelf 2017-07-06 21:32:06 +02:00
parent 427cb2c050
commit ca1371d8b3

View File

@ -83,7 +83,8 @@ class ConfigController extends ActionController
protected function deploymentSucceeded($checksum) protected function deploymentSucceeded($checksum)
{ {
if ($this->getRequest()->isApiRequest()) { if ($this->getRequest()->isApiRequest()) {
return $this->sendJson((object) array('checksum' => $checksum)); $this->sendJson($this->getResponse(), (object) array('checksum' => $checksum));
return;
} else { } else {
$url = Url::fromPath('director/config/deployments'); $url = Url::fromPath('director/config/deployments');
Notification::success( Notification::success(
@ -98,7 +99,8 @@ class ConfigController extends ActionController
$extra = $error ? ': ' . $error: ''; $extra = $error ? ': ' . $error: '';
if ($this->getRequest()->isApiRequest()) { if ($this->getRequest()->isApiRequest()) {
return $this->sendJsonError('Config deployment failed' . $extra); $this->sendJsonError($this->getResponse(), 'Config deployment failed' . $extra);
return;
} else { } else {
$url = Url::fromPath('director/config/files', array('checksum' => $checksum)); $url = Url::fromPath('director/config/files', array('checksum' => $checksum));
Notification::error( Notification::error(