api: Use JsonResponse in form

refs #9606
This commit is contained in:
Eric Lippmann 2015-09-07 13:36:12 +02:00
parent 25abc16e15
commit f467d085b0
1 changed files with 4 additions and 5 deletions

View File

@ -1117,11 +1117,10 @@ class Form extends Zend_Form
// API targets and API requests will never redirect but immediately respond w/ JSON-encoded
// notifications
$messages = Notification::getInstance()->popMessages();
// @TODO(el): Use ApiResponse class for unified response handling.
$this->getResponse()->sendJson(array(
'status' => 'success',
'message' => array_pop($messages) // @TODO(el): Remove the type from the message
));
// @TODO(el): Remove the type from the message
$this->getResponse()->json()
->setSuccessData(array('message' => array_pop($messages)))
->sendResponse();
} elseif (! $frameUpload) {
$this->getResponse()->redirectAndExit($this->getRedirectUrl());
} else {